Set accessibility focus on selected tab in TabsAdapter
Categories
(Firefox for Android :: Tabs, defect, P2)
Tracking
()
| Accessibility Severity | s3 |
People
(Reporter: boek, Unassigned, Mentored)
References
Details
(Keywords: access)
From github: https://github.com/mozilla-mobile/fenix/issues/19139.
When we draw the view holder items, we do not set the selected tab with accessibility focus. We can probably fix this by passing the
isSelectedflag into theTabof the view holder. Then, when the view is attached, we can request focus on it. Without knowing the selected tab, we have to do some awkward checks first:override fun onViewAttachedToWindow(holder: TabViewHolder) { val tabs = tabs ?: return super.onViewAttachedToWindow(holder) val isSelected = holder.tab?.id == tabs.list[tabs.selectedIndex].id if (isSelected) { holder.itemView.requestFocus() holder.itemView.sendAccessibilityEvent( AccessibilityEvent.TYPE_VIEW_FOCUSED ) } super.onViewAttachedToWindow(holder) }┆Issue is synchronized with this Jira Task
Change performed by the Move to Bugzilla add-on.
| Reporter | ||
Updated•2 years ago
|
Comment 1•2 years ago
|
||
I've confirmed that this is a bug in the Composified Tabs Tray, so this should be fixed there as well
Updated•2 years ago
|
Updated•2 years ago
|
Comment 2•1 year ago
|
||
While this issue is not a blocker, it is definitely a bump on the delightful use of the browser, since a screen reader user would have to review all tabs to find out which one is, in fact, selected. It would make the navigation unnecessary cumbersome for both the screen reader and the switch access and other alternative input sources users, including those with limited dexterity who are especially affected.
Comment 3•1 year ago
•
|
||
Posting some notes from doing a couple hours of investigation today:
I tried two approaches
Approach 1 - Pass a boolean down from the tab list/grid root container to do a one-time focus request on the tab
- Tab items themelves will perform the focus request use
FocusRequesterandModifier.focusRequester
Result
- The focus requester wasn’t working
Approach 2 - Attempt to use traversal groups in the Modifier.semantics node
- The banner would have a traversal index to be placed after the tabs
Result:
- Traversal order was seemingly not working either.
- May need a simpler example of traversal groups before trying to apply it to something as complex as Tabs Tray.
Comment 4•1 year ago
|
||
Gave this another pass yesterday:
Approach - Passing down a focus requester
- The
TabGridcomposable passed down a FocusRequester object to theTabGridItem TabGridItemwould attach it viaModifier.focusRequester()- A
LaunchedEffect(Unit)would callfocusRequester.requestFocus()
Result
- The active/selected tab still did not receive focus (even when applying a
delay)
Updated•1 year ago
|
Comment 6•1 year ago
•
|
||
I filed a companion bug to this bug as bug 1904430. When testing, it appears there is no way for a TalkBack user to know the current tab. This information is conveyed visually through the purple ring around the current tab, but not conveyed in TalkBack. (Not related to moving focus, but impacting the same user experience.)
Comment 7•1 year ago
|
||
@Noah, we were looking at this as part of the #mobile-community-outreach to audit our good-first-bug. Given that this is a talkback focus bug that already took several passes to determine the best approach, we're thinking this might not be a good-first-bug.
Description
•