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

allowOutsideClick with long dropdown #2154

Closed
bytestream opened this issue Jan 21, 2021 · 4 comments
Closed

allowOutsideClick with long dropdown #2154

bytestream opened this issue Jan 21, 2021 · 4 comments

Comments

@bytestream
Copy link

bytestream commented Jan 21, 2021

Current behavior

I have a long dropdown menu which is enhanced by a dropdown library: https://github.com/selectize/selectize.js (similar to Select2)

If you click on options which overflow outside of the modal then the modal closes. If you click on options within the modal, then they're selected as you'd expect. For example:

  • Option 2 can be selected OK
  • Option 6 closes the Sweetalert2 modal

Expected behavior

I expect to be able to click option 6 without the modal closing.

Live demo

https://jsfiddle.net/bytestream/swyngx62/1/

@bytestream
Copy link
Author

I should add this behavior only affects Firefox, it works fine in Google Chrome (tested on latest Linux versions).

@limonte
Copy link
Member

limonte commented Jan 21, 2021

I'm able to reproduce, interesting. Thanks for reporting, I'll investigate this.

@limonte
Copy link
Member

limonte commented Jan 24, 2021

The issue is in selectize.js which selects the item not with the click event, but with the mousedown event, which isn't aligned with the native <select> and completely unexpected.

Either use more sensible plugin as Select2 or disallow backdrop clicks by setting allowOutsideClick to false.

@limonte limonte closed this as completed Jan 24, 2021
@bytestream
Copy link
Author

Thanks for investigating @limonte ! I'll report pass this on to selectize

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

2 participants