You can never click on a select element to close the popup associated popup menu.
The popup menu is only closed by either clicking on the popup menu or by clicking elsewhere to no longer focus on the popup menu.
This becomes an issue when you double click on a popup menu while you are not focused on the app containing the popup menu.
The select element thinks there are two clicks back to back on the select element, which normally should never be able to happen.
This back to back click results in the popup menu being visible but also the popup menu proxy being invalidated. Note that the popup menu does not disappear, it remains visible (which is the desired behavior). This happens because at the time of the second click the popup menu has not been actually been created yet, so there's nothing to dismiss.
As a result when we actually close the popup we do not set the visible flag to false because the PopupMenuProxy is invalidated.
Then when we try to open up the popup again, nothing happens (no popup appears) because we think that the popup is already visible.
The fix here is to make sure we do not try to invalidate the popup menu at the wrong time. In this case, the wrong time is when you're clicking on the select element itself. We should never attempt to hide the popup menu as a result of clicking on the select element.
Created attachment 237649 [details]
Comment on attachment 237649 [details]
Can we make a test for this?
Discussed test with smfr in person and determined that it wasn't feasible since the test infrastructure doesn't allow tests that involves switching to and from more than one window.