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
Enter key still works on disabled select when ID is set #4695
Comments
Still a bug. I made a temporary fix. |
Yup, also happened to me. @esl-douglas's fix seems to do the trick. Thanks! |
By the way, these lines seem to be the ones forcing the opening: select2/src/js/select2/core.js Lines 319 to 353 in 062c6c3
Maybe just checking the state of the select should do the trick? |
Sure, want to make the fix, write up a few tests, and submit a PR? Looks like in other parts of the codebase, we use some simple logic to return early when the control is disabled: select2/src/js/select2/core.js Lines 448 to 450 in 062c6c3
|
This issue also exists in the examples app. Clicking on the disabled dropdown and hitting the space key will allow the user to chose a new option and change the value of the dropdown. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This still seems to be an issue in 4.0.5. I'm surprised more people haven't reported it! |
Any plans to close this in next release? I guess this is where the test has to be made and select2/src/js/select2/core.js Lines 348 to 355 in 04fce55
|
For anyone using select2.full.min.js, you may search for "a.open" and replace that part of the code with the one below: this.options.get("disabled") ? b.preventDefault() : a.open() This will inspect if the select2 element is disabled and prevent any further action. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I am going to reopen this issue for another stale cycle. |
This was fixed in 4.0.13 by #5751. |
Prerequisites
master
branch of Select2Steps to reproduce the issue
Expected behavior and actual behavior
When I follow those steps, I see the dropdown open on a disabled select, that should never be possible.
Environment
Browsers
Operating System
Libraries
Isolating the problem
The text was updated successfully, but these errors were encountered: