-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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: Keep focus on input after select to improve accessibility #1727
Conversation
👷 Deploy request for vueselect accepted.
|
Thanks for this! This behaviour is definitely how the component should work. This needs some refining though before I can merge. After a selection has been made, the input still has focus, but it's unresponsive. There's no way to bring the dropdown back up after a selection was made since the open state is tied to input focus. I think what likely needs to happen, is the outer div of the template gets |
No problem and thanks for taking a look! I've tried reproducing this locally and on https://deploy-preview-1727--vueselect.netlify.app/sandbox.html but both seem to work for me as after selecting an option I can hit Enter to reopen the dropdown and make another selection. Which steps can I take to reproduce the unresponsiveness? |
fed8148
to
dde83a8
Compare
Here's what we'll need. These are basically test cases. After a selection has been made and the dropdown is closed but the input remains in focus:
In the next major, clicking into the search input when |
dde83a8
to
3f7bfcb
Compare
Made the changes and added some tests, what do you think @sagalbot? |
This is looking awesome. A huge upgrade to accessibility for the component and something that I've really wanted to fix for a long time now. Thanks @Pytal! |
Signed-off-by: Christopher Ng <chrng8@gmail.com>
- Comply with W3C accessibility guidelines - Single-select example: https://www.w3.org/WAI/ARIA/apg/example-index/combobox/combobox-select-only.html - Multi-select example: https://www.telerik.com/kendo-angular-ui/components/dropdowns/multiselect/accessibility/ Signed-off-by: Christopher Ng <chrng8@gmail.com>
- Comply with W3C accessibility guidelines - Expected behaviour described in https://www.w3.org/WAI/ARIA/apg/example-index/combobox/combobox-select-only.html Signed-off-by: Christopher Ng <chrng8@gmail.com>
- Only move typeAheadPointer when dropdown is open Signed-off-by: Christopher Ng <chrng8@gmail.com>
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Signed-off-by: Christopher Ng <chrng8@gmail.com>
3f7bfcb
to
a7af988
Compare
Released in You might want to consider setting up a GitHub sponsor profile.. just sayin! |
Hi all! You are doing an excellent work. But we have one problem with this new behavior after the 3.20.1 updates. On the input event, we call the API and open the bootstrap-vue b-modal dialog before the endpoint call completes. After closing the modal dialog, the dropdown list reopens, and this new behavior is something we don't expect at all. How can we leave the dropdown menu closed after closing the modal dialog. Maybe new props need to be made to prevent this behavior?! Thanks! |
Thanks, @Yury-Shautsou-GY if possbile, could you provide a reproduction link? |
Accounts for changes introduced in vue-select v3.20.1; sagalbot/vue-select#1727. Otherwise, pressing enter followed by tab would replace the selection with the first option before jumping to the next input.
Keep focus on the input after option selection and when hitting the Escape key to comply with W3C accessibility guidelines as demonstrated and described in: