I am currently unable to tab into a Select2 enabled <select>
element in Firefox (38.0.5) – in other words, cannot access to select <option>
in a mouseless manner. In Chrome, you can tab through a form and press enter in order to start selecting an item in the Select2 select
element. I have not tested in other browsers, but before submitting an actual bug report I want to verify whether others are experiencing the same issue?
You can duplicate on the demo page.
- Select2 v4.0.0
- Twitter Bootstrap 3.3.4 (although have not added any
additional items to style for Bootstrap) - Firefox v38.0.5
4
Answers
This was really bothering me too, so I set it to open on focus. So when tabbing to the select, it will open automatically.
Hope that helps, I’m in a different version of Bootstrap and firefox, so let me know if it doesn’t!
While its not a perfect solution, the following is what we are using to simulate normal keyboard navigation on an HTML form that contains a Select2 element.
Building on zDaniels excellent answer.
I have created a bower installable version of the code.
Source and documentation at
https://github.com/peledies/select2-tab-fix
Use @zDaniels Answer, it is working like a charm. But the only problem is it will not close the last select2. To resolve this, you could write a jquery function with the below line in the on-change event of your last select2 element.
I hope this helps to make a tweak.