Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clicking optgroup closes dropdown #1382

Closed
5 tasks done
samesfahani opened this issue Mar 6, 2018 · 3 comments
Closed
5 tasks done

Clicking optgroup closes dropdown #1382

samesfahani opened this issue Mar 6, 2018 · 3 comments

Comments

@samesfahani
Copy link

samesfahani commented Mar 6, 2018

I did:

  • Search for if my issue has already been submitted
  • Make sure I'm reporting something precise that needs to be fixed
  • Give my issue a descriptive and concise title
  • Create a minimal working example on JsFiddle or Codepen
    (or gave a link to a demo on the Selectize docs)
  • Indicate precise steps to reproduce in numbers and the result,
    like below

Example: http://www.iainheng.com/assets/fo/scripts/selectize0/examples/optgroups.html

If you open up any of the dropdowns on the demo with an optgroup, clicking the optgroup will close the entire dropdown even with closeAfterSelect set to false. This behavior is not standard with native optgroups.

@samesfahani
Copy link
Author

Possible culprit: https://github.com/selectize/selectize.js/blob/master/src/selectize.js#L226

Seems like this logic doesn't handle the case where e.target was the div that represents the optgroup. Adding something like a || $.contains(self.$dropdown[0], e.target) to the condition set (to short circuit) might fix the issue... Can't speak to how performant that is though.

@MeesterDev
Copy link

I think #762 should fix this.

@risadams
Copy link
Contributor

risadams commented Dec 1, 2020

closing stale issues older than one year.
If this issue was closed in error please message the maintainers.
All issues must include a proper title, description, and examples.

@risadams risadams closed this as completed Dec 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants