Announce accessibility state changes happening in the background#26624
Announce accessibility state changes happening in the background#26624xuelgong wants to merge 2 commits into
Conversation
[Problem] Currently the react native framework doesn't handle the state changes of the focused item that happen not upon double tapping. Screen reader doesn't get notified when the state of the focused item changes in the background. [Solution] On iOS, post a layout change notification for every state changes. On Android, send a click event whenever state "checked", "selected" or "disabled" changes. In the case that such states changes upon user's clicking, the duplicated click event will be skipped by Talkback. [Testing] Add a nested checkbox example which state changes after a delay in the AccessibilityExample.
|
Overall the implementation looks good, but I added a few comments inline that I think will help clarify exactly what is being added here. |
| } | ||
| } | ||
|
|
||
| class NestedCheckBox extends React.Component { |
There was a problem hiding this comment.
While this example is functioning how you intended it to, I found it pretty confusing at first why it was checking/unchecking multiple boxes when I selected one. I don't see how adding these additional checkboxes helps to showcase this feature either, as it could easily be shown with a single checkbox that gets checked on a delay.
There was a problem hiding this comment.
This example mimics ordering a pizza. When "meat" is chosen, all meats are checked. If only "beef" or "bacon" is selected, the state of the checkbox "meat" becomes "mixed". The reason I created nested checkboxes is to make sure that the state change of the unfocused item won't be announced. That is, if all meats are checked previously and then deselect beef, only the state change of "beef" checkbox will be announced. Even though the "meat" checkbox state also changes, screen reader shouldn't announce it.
facebook-github-bot
left a comment
There was a problem hiding this comment.
@cpojer is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
This pull request was successfully merged by @xuelgong in baa66f6. When will my fix make it into a release? | Upcoming Releases |
…ening in the background (facebook#26624)
Summary
Currently the react native framework doesn't handle the accessibility state changes of the focused item that happen not upon double tapping. Screen reader doesn't get notified when the state of the focused item changes in the background.
To fix this problem, post a layout change notification for every state changes on iOS.
On Android, send a click event whenever state "checked", "selected" or "disabled" changes. In the case that such states changes upon user's clicking, the duplicated click event will be skipped by Talkback.
Changelog
[General][Fixed] - Announce accessibility state changes happening in the background
Test Plan
Add a nested checkbox example which state changes after a delay in the AccessibilityExample.