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
Loses focus on close. #4971
Comments
Same issue. Using tab, arriving on select2 elem. Hit enter, it opens, I select the entry - focus is lost. Results, next tab go top of page according to tab-indexes |
Same issue in 4.0.3. This seems to work as a workaround edit to select2.js
|
Workaround in userland (not thoroughly tested): $('select').select2().on('select2:close', function(e) {
let select2 = $(this).data('select2');
select2.$selection.focus();
}); |
Is this related to the problem addressed in #4860? |
It seems so. I'm only just looking into Select2, so not really familiar with the code base (nor it's general issues). |
Hmm. Seems like creating a Github Project might be a good way to aggregate these related issues for now. |
Ok, created this project: https://github.com/select2/select2/projects/2 |
@alexweissman this seems like a different issue: after selecting an issue with the keyboard -> the focus is lost -> pressing tab again starts over from the beginning of the page -> you have to go over the sidebar links to get back at the autocomplete. |
No, @jpic I am fairly sure that this is the same issue. After merging in @nino-s 's fix (#4427) and releasing 4.0.4, you can see that this problem no longer occurs on the demo page: https://select2.org/getting-started/basic-usage |
Apparently the issue is back. See demo-page. |
This issue is still present in latest 4.0.6 and 4.0.7 rc.0 For me when I click one select and then click another select, the focus stays with the previous select. |
Prerequisites
master
branch of Select2Steps to reproduce the issue
Expected behavior and actual behavior
When I follow those steps, I see... that the focus is not on the current select2 element.
I was expecting... the focus should still be on the select2 element, and then when I press tab, it should go to the next select2 element. The latest version is not keyboard friendly. I would love the keyboard behaviour in v3.5.3.
Environment
Browsers
Operating System
Libraries
Isolating the problem
The text was updated successfully, but these errors were encountered: