-
Notifications
You must be signed in to change notification settings - Fork 54
[Bug Fix] [React Native New Architecture]: Narrator is not announcing any success message on invoking 'Copy to clipboard' button. #621
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
Conversation
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR addresses a screen reader bug by replacing direct announcements with updates to accessibilityValue, enabling Fabric support for announcing clipboard copy/paste status.
- Removes
AccessibilityInfoimport and related calls - Introduces two state variables for
accessibilityValueon the Copy and Paste buttons - Updates
onPressandonAccessibilityTaphandlers to reset and set the value for announcements
Comments suppressed due to low confidence (2)
NewArch/src/examples/ClipboardExamplePage.tsx:13
- [nitpick] The state names
accessibilityValueCopyandaccessibilityValuePasteare verbose. Consider renaming them to something likecopyStatusMessageandpasteStatusMessageto clarify their intent.
const [accessibilityValueCopy, setAccessibilityValueCopy] = useState('');
NewArch/src/examples/ClipboardExamplePage.tsx:47
- There are no tests verifying that accessibilityValue updates trigger announcements. Consider adding a test to assert that the success message is set on the button after press.
<Button
|
This change seems okay for now, while we are working on getting a working AccessibilityInfo implementation. Can you file an issue in the repo noting that we should remove these changes once AccessibilityInfo is working? Can you also add a comment to each code block in this PR with // Issue #: Workaround; Remove once AccessibilityInfo module is implemented? This way we can keep track of this change as a workaround. |
Created issue #622 and added comment |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
once announceForAccessibility is added to RNW then this workaround can be removed , ig we can do it using accessibilityLabel which is supported by rnw now for narrator annoucement and hook for now this looks good .
|
LGTM! |
Description
Why
Repro-Steps:
Launch the React Native Gallery- Experimental app.
Navigate to the 'Expand menu' button and invoke it.
Navigate to 'Home' button and invoke it.
Navigate to 'Clipboard' button and invoke it.
Observe the announcement and behavior.
Actual Result:
On invoking the 'Copy to clipboard' button, Narrator is not announcing any success message.
Note: Visually also no changes appeared on invoking 'Copy to clipboard' button.
Expected Result:
On invoking the 'Copy to clipboard' button, visually the 'Copied' message should appear and Narrator should announce as "Copied to clipboard".
User impact:
Users with visual impairment who rely on screen reader might get confused if narrator does not announce any success message.
MAS Reference: MAS 4.1.3 – Status Messages
Trap ID: 1.9 - Feedback Failure
Resolves #586
What
Implementation of AccessibilityInfo.announceForAccessibility for Fabric is not done yet.
Doing a workaround and using accessibilityValue for now as the functionality is same.
Related PR: microsoft/react-native-windows#14858
Related Issue: #605
Screenshots
Microsoft Reviewers: Open in CodeFlow