ui-select
ui-select copied to clipboard
Clicking outside of the Select should always close the Select
In commit aef5a8088b749b6c3d5c5d3d12998d7a30e8bdfd, support was added for close-on-select. These changes included the addition of the 'clickTriggeredSelect ' property on the controller. The 'clickTriggeredSelect' is preventing the first click outside of the Select from closing the Select if any item has been selected with a mouse click prior to the external click.
Reproduction Steps w/ close-on-select=true:
- Open a Select, single or multi, by any means (click or enter), with close-on-select = true
- Using the mouse, select an item.
- Re-open the Select by using tab/enter.
- Using the mouse, click anywhere outside of the Select.
- Clicking again outside the Select will close the Select.
Expected Behavior after step 4: The Select should be closed. Actual Behavior after step 4: The Select is still open.
:+1: Getting the same issue
+1
1.5 year has passed, the bug is still there... looking forward to the fix ^^
@nhim feel free to put up a PR :)
A plunkr might go also help any fixers
Had a look at this issue and I think the clickTriggerSelect is not set correctly.
On Line 385 the clickTriggerSelect is set to true but never back to false. At the onDocumentClick there is a check if this is true or false. When the if statement is not true it will set the clickTriggerSelect to false, that is the reason why it will close the second time.
Have made a plunker to see if this will resolve the issue.
Let me know then I will commit the changes. :smile:
p.s. don't know the reason why clickTriggerSelect was introduced so maybe this is not the required behaviour
@user378230 , do you think I need to submit this as a PR?
@jmckinney88 Did you find some time to test this? Thanks
@jefiozie I have not yet and am away from my desktop at the moment, but I can take a look tomorrow. Thanks for the tag.
@jmckinney88 Did you have some time to check this? If not can you do if this is the correct behavior I can make a PR on it.
Checked it against latest version still not working.
@jmckinney88 any feedback?