The only way I can do this is probably to work more than just make it act right, no matter how the focus is lost. Essentially, you will have to rewrite it so that it performs the action, not when the focus has been lost, but when another element on the page receives focus after the original element has focus. Since the Minimum button is not part of the page, it will not trigger an event until it is expanded and the other element is focused. I can think of many things that will go wrong, and the code is likely to be very complex to handle this one requirement.
source
share