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

Click on bottom of select2 box causes unintentional selection of first option #48

Open
adrianstaffen opened this issue Aug 26, 2021 · 0 comments

Comments

@adrianstaffen
Copy link

If a select2 box is clicked on the very bottom the first option is unintentionally selected.

This happens because on the mousedown the dropdown is opened, the cursor is now on the first option, and on the mouseup the option is clicked.

In my case the user wants to open a product attribute filter, but unintentionally selects the first option with the click on the select box. The whole page reloads because the form is automatically submitted.

I tested this in the browsers Chrome, Firefox and Safari. The issue occurs in all of them.

You can try it yourself with one of the samples.

The original select2 library doesn't have this issue.

I temporarily fixed it by putting the options a few pixels down:
.select2-dropdown { padding-top: 2px; }

But would be happy about a real fix.
Thank you!

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

1 participant