Skip to content
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(select): announce placeholder, hide select text from screenreaders #22556

Merged
merged 9 commits into from Nov 25, 2020

Conversation

brandyscarney
Copy link
Member

@brandyscarney brandyscarney commented Nov 23, 2020

Fixes:

  • Hides select text from screen readers so it isn't announced twice (Android talkback needs this)
  • Adds the placeholder text to be announced if there is no value
  • Don't add a comma if there is no value/placeholder (NVDA speech viewer)
  • Don't announce alert label twice

@github-actions github-actions bot added the package: core @ionic/core package label Nov 23, 2020
@liamdebeasi
Copy link
Contributor

Press Label

native alert popover action sheet custom label
VoiceOver macOS - Chrome Dog, Favorite Pet, collapsed, button Dog, Favorite Pet, collapsed, button Dog, Favorite Pet, collapsed, button Dog, Favorite Pet, collapsed, button Dog, Favorite Pet, collapsed, button
VoiceOver macOS - Safari Dog, Favorite Pet, popup button Dog, favorite pet, list box pop up, button Dog, favorite pet, list box pop up, button Dog, favorite pet, list box pop up, button Dog, favorite pet, list box pop up, button
VoiceOver iOS Favorite Pet, Dog, popup button Dog, Favorite Pet, pop up button, list box pop up Dog, Favorite Pet, pop up button, list box pop up Dog, Favorite Pet, pop up button, list box pop up Dog, Favorite Pet, pop up button, list box pop up
Android 7 TalkBack Collapsed, dog, pop up button, favorite pet Dog, favorite pet, pop up button Dog, favorite pet, pop up button Dog, favorite pet, pop up button Dog, favorite pet, pop up button
Android 10-11 TalkBack Collapsed, dog, pop up button, favorite pet Dog favorite pet, pop up button, dog, dog favorite pet Dog favorite pet, pop up button, dog, dog favorite pet Dog favorite pet, pop up button, dog, dog favorite pet Dog favorite pet, pop up button, dog, dog favorite pet
Windows NVDA N/A N/A N/A N/A N/A
  • NVDA displays ", Favorite Pet menu button collapsed subMenu" when no option is selected. Maybe we can only add the comma in our label if there is a selected value?

Tab to Focus

  native alert popover action sheet custom label
VoiceOver macOS - Chrome Dog, Favorite Pet, collapsed, button Dog, Favorite Pet, collapsed, button Dog, Favorite Pet, collapsed, button Dog, Favorite Pet, collapsed, button Dog, Favorite Pet, collapsed, button
VoiceOver macOS - Safari Dog, Favorite Pet, pop up button Dog, favorite pet, list box pop up, button Dog, favorite pet, list box pop up, button Dog, favorite pet, list box pop up, button Dog, favorite pet, list box pop up, button
VoiceOver iOS N/A N/A N/A N/A N/A
Android 7 TalkBack N/A N/A N/A N/A N/A
Android 10-11 TalkBack N/A N/A N/A N/A N/A
Windows NVDA Favorite Pet, combo box, Dog collapsed Dog, Favorite Pet, menu button, collapsed, subMenu Dog, Favorite Pet, menu button, collapsed, subMenu Dog, Favorite Pet, menu button, collapsed, subMenu Dog, Favorite Pet, menu button, collapsed, subMenu

Open

  native alert popover action sheet custom label
VoiceOver macOS - Chrome Dog, menu item, menu 6 items Favorite Pet, and 3 more items, dialog Dog and 1 more item and 5 more items, dialog Dog and 5 more items and 1 more item, dialog Dog and 5 more items and 2 more items, dialog
VoiceOver macOS - Safari menu 6 items ✔️, Dog Favorite pet and 3 more items, web dialog Dog, and 11 more items, group Dog, and 6 more items, web dialog Dog and 5 more items and 2 more items, web dialog
VoiceOver iOS Favorite Pet, Dog, pop up button, Dog, picker item, adjustable, 1 of 6 Web Dialog, Favorite Pet, headling level 2 Dog Dog, Web Dialog, Dog, button Dog, Web Dialog, Dog, radio button, checked 1 of 6
Android 7 TalkBack Checked, dog, in list, 6 items Dialog, double tap and hold to long press -- Dialog, double tap and hold to long press Dialog, double tap and hold to long press
Android 10-11 TalkBack Alert, Dog, selected checked dog, in list Dialog, favorite pet, heading 2, favorite pet, radio group out of pager Out of pager Dialog, dialog, out of pager Dialog, radio group, out of pager
Windows NVDA list, Dog 1 of 6 heading level 2, Favorite Pet, grouping, radio button, checked, Dog, radio button [checked/not checked] [LABEL], out of grouping button, CANCEL, button OK Expanded, clickable Dog, button [LABEL] [checked/not checked] expanded, dialog Radio button [checked/not checked] [radio label] [reads all buttons]
  • The first option is always selected for the ionic components on iOS. So even if you have Goldfish selected, it will still read Dog first since that is the first option.
  • The backdrop/overlay container is always selected for ionic components on Android

Axe

General:

ARIA attributes must confirm to valid values. Invalid ARIA attribute value: aria-hidden=""

<div aria-hidden="" class="select-text" part="text">Dog</div>

Popover:

Buttons must have discernible text:

.radio-checked button
<button type="button" tabindex="0"></button>

All page content must be contained by landmarks:

.item-radio-checked .item-inner
<div class="item-inner"><div class="input-wrapper"><slot></slot></div><slot name="end"></slot><div class="item-inner-highlight"></div></div>

Action Sheet:

All page content must be contained by landmarks

.action-sheet-wrapper
<div class="action-sheet-wrapper ion-overlay-wrapper sc-ion-action-sheet-md" role="dialog">

@liamdebeasi liamdebeasi added this to the 5.5.1 milestone Nov 24, 2020
@brandyscarney brandyscarney merged commit ea52db6 into master Nov 25, 2020
@brandyscarney brandyscarney deleted the fix-select-placeholder-a11y branch November 25, 2020 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: core @ionic/core package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants