Improve screen reader accessibility - #2
Conversation
7a10378 to
4f81895
Compare
8e2025a to
ad6350d
Compare
4f81895 to
7248a06
Compare
ff291f1 to
f1e6228
Compare
7248a06 to
ddbd27b
Compare
|
To test, I changed https://github.com/salemove/visitor-app/blob/master/package.json#L28 to The idea could be to use the branch name Merging to |
Or maybe it's not ready yetWithout any changes here, the phone input in the visitor-app is again failing with (to see the error I add Changing and I don't think such updates are ever needed. UPDATE: using dist built with node 8.17.0 is working! |
94cc807 to
cb3180a
Compare
Ramp task: https://ramp.accessibleweb.com/app/websites/83ca83c6265c/tasks/2787246f7ae2 This allows following WAI-ARIA best practices for combobox elements - https://www.w3.org/WAI/ARIA/apg/patterns/combobox/. Changes in this PR mostly correspond to the patw0929#405 Although most of the best practices to improve accessibility were implemented, the role="combobox" was not added neither the to the number input (because the input doesn't show/hide the dropdown), nor to the country code button. Looks like OSx VoiceOver announces everything correctly. Changes: - Add role="listbox" to the countries list - Refer the countries list by its Id in the country code button via aria-controls and aria-owns - Add role="option" to each country list option - Use aria-expanded on the country code button element - Refer focused option by its Id in the country code button element via aria-activedescendant to read focused option while navigating by keyboard - Add aria-selected="true" to the selected list option - Set aria-autocomplete="none" to the country code button element since displayed options do not depend on the number input value - Allow passing arbitrary props to the country code button element via flagDropdownProps prop (for example, "aria-labelledby" property can be passed) Updates dist files (built with node 8.17.0)
ddbd27b to
11ade03
Compare
|
The dist files in the repository are needed because they are used in visitor-app, but this package isn't built on visitor-app I tried to make it building on install, but no luckIf I have I'd be happy if you have a suggestion on how to avoid committing build files with every change. |
|
I am also not sure what is a better way to do it. But considering that we want to get rid of this library anyway, I think what you already have is not too problematic. There probably will not be much more changes to this lib anyway and hopefully we migrate to new phone component soon. |
This will solve the problem when texts in other languages do not have corresponding "lang" attribute. lang="en" for each country name is added to handle the case when the package is used in non-english page. Task: https://ramp.accessibleweb.com/app/websites/83ca83c6265c/tasks/7e2074f1f904
This is a fix for #2 The country code button should still have role="combobox". This role communicates that the component will open a listbox. This is the case of a Select-Only Combobox https://www.w3.org/WAI/ARIA/apg/example-index/combobox/combobox-select-only.html
This is a fix for #2 The country code button should still have role="combobox". This role communicates that the component will open a listbox. This is the case of a Select-Only Combobox https://www.w3.org/WAI/ARIA/apg/example-index/combobox/combobox-select-only.html Fix broken tests
Ramp task #100143. This allows following WAI-ARIA best practices for combobox elements.
Changes in this PR mostly correspond to the PR to the original react-intl-tel-input.
Although most of the best practices to improve accessibility were implemented, the
role="combobox"was not added neither the to the number input (because the input doesn't show/hide the dropdown), nor to the country code button.Looks like OSx VoiceOver announces everything correctly.
Changes:
role="listbox"to the countries listrole="option"to each country list optionaria-expandedon the country code button elementaria-activedescendantto read focused option while navigating by keyboardaria-selected="true"to the selected list optionaria-autocomplete="none"to the country code button element since displayed options do not depend on the number input value"aria-labelledby"property can be passed)Also, this PR makes country names shown in English only.
This solves the problem when texts in other languages do not have a corresponding "lang" attribute. #100025
lang="en"for each country name is added to handle the casewhen the package is used on a non-English page.
Types of changes
Checklist: