ui-select icon indicating copy to clipboard operation
ui-select copied to clipboard

Clicking outside of the Select should always close the Select

Open jmckinney88 opened this issue 9 years ago • 10 comments

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:

  1. Open a Select, single or multi, by any means (click or enter), with close-on-select = true
  2. Using the mouse, select an item.
  3. Re-open the Select by using tab/enter.
  4. Using the mouse, click anywhere outside of the Select.
  5. 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.

jmckinney88 avatar Jun 04 '15 20:06 jmckinney88

:+1: Getting the same issue

Jaco-Pretorius avatar Jun 12 '15 12:06 Jaco-Pretorius

+1

JonWallsten avatar Nov 02 '15 14:11 JonWallsten

1.5 year has passed, the bug is still there... looking forward to the fix ^^

nhim175 avatar Aug 04 '16 08:08 nhim175

@nhim feel free to put up a PR :)

A plunkr might go also help any fixers

user378230 avatar Aug 04 '16 09:08 user378230

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

Jefiozie avatar Aug 15 '16 18:08 Jefiozie

@user378230 , do you think I need to submit this as a PR?

Jefiozie avatar Aug 22 '16 18:08 Jefiozie

@jmckinney88 Did you find some time to test this? Thanks

Jefiozie avatar Aug 28 '16 17:08 Jefiozie

@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 avatar Aug 28 '16 18:08 jmckinney88

@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.

Jefiozie avatar Oct 23 '16 16:10 Jefiozie

@jmckinney88 any feedback?

Jefiozie avatar Nov 04 '16 12:11 Jefiozie