ui-select2
ui-select2 copied to clipboard
clicking outside the control does not close the opened dropdown list
- click on a angular-ui / ui-select2 control
- 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)
- the drop down list remains open
- 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.
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.