Skip to content

Support role=application TV apps#14

Merged
PatrykMis merged 2 commits intomainfrom
application_role
Dec 6, 2021
Merged

Support role=application TV apps#14
PatrykMis merged 2 commits intomainfrom
application_role

Conversation

@PatrykMis
Copy link
Member

Originated from PR #8 on upstream.

Credits to Hugo

hugoholgersson and others added 2 commits December 6, 2021 21:19
After: The green rect follows web focus.
Before: TalkBack tries to read the TV apps as text documents.

Background:
Within <xxx role=application>...</xxx>, screen readers
should not consume DPAD (arrow key) events. Web apps
or widgets with role=application have, per the WAI-ARIA
spec's contract, their own JavaScript logic for moving
focus [1].

[1] w3c/aria#1049, where we discussed this.

Problem:
TalkBack does not handle role=application so such web
apps lose their 4-way (up/down/left/right) navigation.
TalkBack only moves forward/backward which breaks
authors' pre-defined TV UX.

Solution:
Whenever accessibility focus (the green rect) goes to
some web content with <body role=application> or anywhere
within a role=application widget, we don't consume the
DPAD events; we let them through.

Testing done:
Open a simple TV web app that has <body role=application>.
Notice:
 Once the web view gets accessibilty focus, TalkBack
 won't eat (consume) DPAD key events and the the key
 events reach the web page's key handler in JavaScript.
@PatrykMis PatrykMis merged commit 6125df6 into main Dec 6, 2021
@PatrykMis PatrykMis deleted the application_role branch December 6, 2021 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants