-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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
Fix keyboard navigation for toggle buttons (checkbox, radio, single toggle) following a mouse click #19192
Conversation
Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED Commit: f51ac9a (Please note that this is a fully automated comment.) |
Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED Commit: 585e0f2 (Please note that this is a fully automated comment.) |
Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED Commit: d0d8bf0 (Please note that this is a fully automated comment.) |
Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED Commit: 70d33f7 (Please note that this is a fully automated comment.) |
Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED Commit: 81e4bf3 (Please note that this is a fully automated comment.) |
maybe i'm misunderstanding your compatibility table there, but even for http://jsfiddle.net/vjjmj4da/9/ (just tested in chrome and firefox) i can submit on enter for checkboxes and radio buttons, select radio buttons with left/right, toggle checkboxes with space. |
Hi @patrickhlauke! You appear to have posted a live example (http://fiddle.jshell.net/vjjmj4da/9/show/light/), which is always a good first step. However, according to the HTML5 validator, your example has some validation errors, which might potentially be causing your issue:
You'll need to fix these errors and post a revised example before we can proceed further. (Please note that this is a fully automated comment.) |
@patrickhlauke |
well, works for me (just tested in Windows for now in Chrome/Firefox) https://www.youtube.com/watch?v=7aQych3ueX0 |
Ok, looking at your actual code change, I think I'm understanding what you're saying - this wasn't clear in your actual description. Do you mean that after doing an initial selection with the MOUSE (e.g. clicking on a radio button), then keyboard doesn't work (and hence you explicitly set focus to it? In that case yes, I can see the issue and how your patch addresses that - and the other part is a simplification of |
@patrickhlauke Concerning the failling travis tests, I'm a bit lost :(. I don't know how to fix them.
The
|
Yeah, now I'm with you. The fix looks good to me. Will double-check in a bit and merge. I think travis and savage are ... having a moment ther, as I don't think the tiny change in your code should cause those issues. So just ignore for now. |
@patrickhlauke Both build failures are legitimate. These changes are causing some button.js unit tests to fail. |
Yeah sorry just seen that as I look deeper into it. The issue appears when it's a so, you'll need some extra check there to make sure this only triggers focus when there IS an actual input. |
@cvrebert shouldn't the code as is be acceptable though? when |
What I don't understand is :
In fact, to be really nice I should use |
Manage inputs and buttons
Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED Commit: 88a2761 (Please note that this is a fully automated comment.) |
Manage mixed button/input scénarii
Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED Commit: ecb3496 (Please note that this is a fully automated comment.) |
I've updated the test to manage some serious cases for the tests, but Travis give this error :
How is it possible? |
@fabdouglas i'm also not quite sure why/how those would fail in qunit. digging in deeper (but i definitely don't think it's anything that you're necessarily doing wrong at your end...hang in there ;) ) |
@fabdouglas You need to use Lines 11 to 48 in ad5e656
|
Tests passed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: CONFIRMED Commit: 314bcb8 (Please note that this is a fully automated comment.) |
Looks good now. We'll squash the commits on our end when merging. |
And we should mention this in the visual test of the buttons plugin to help prevent future regressions. |
@fabdouglas Merged. Thank you! |
Yup, great stuff, merci @fabdouglas |
This PR fixes the keyboard navigation again while still keeping twbs#16223 fixed. Closes twbs#19192
#16226 has fixed #16223 but also has broken the keyboard navigation.
This PR, still fixes #16226, but also restores the keyboard navigation broken by #16223.
3.3.6 status :
jsfiddle (look the console) : http://jsfiddle.net/vjjmj4da/9/
3.3.6+PR status :
jsfiddle (look the console) : http://jsfiddle.net/vjjmj4da/13/