Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

clicking outside the control does not close the opened dropdown list #211

Open
themajix opened this issue May 17, 2014 · 1 comment
Open

Comments

@themajix
Copy link

  1. click on a angular-ui / ui-select2 control
  2. the dropdown list opens
    3 do not make a selection from the dropdown list
    4 click anywhere else on the page (other than the control)
  3. the drop down list remains open
  4. in order to close the dropdown, either a selection must be made, or the control must be focused (for example by clicking on an empty area of the control) and then the escape key must be hit

The expected behavior is that the dropdown must be closed by clicking anywhere outside the control.

@premiumhamsandwich
Copy link

I know this library is deprecated, but I had the same issue and it came down to z-index issues.

There is a transparent mask overlay with id "select2-drop-mask" applied that goes right beneath the active drop-down. These were on a div with fixed positioning that had a higher z-index.

Solution: ensure both the overlay and the dropdown (.select2-drop-active) have higher z-indicies than everything else. Clicking anywhere other than the dropdown will trigger a click event on the overlay and the dropdown should close.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants