Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Image does not announce "disabled" (#31252)
Summary: This issue fixes #30935 screenreader does not announce Image disabled accessibilityState. As stated in AOSP View.java, the framework will handle routine focus movement, views indicate their willingness to take focus through the `isFocusable` method https://bit.ly/3dCnyHb ``` * <p>The framework will handle routine focus movement in response to user input. This includes * changing the focus as views are removed or hidden, or as new views become available. Views * indicate their willingness to take focus through the {link #isFocusable} method. To change * whether a view can take focus, call {link #setFocusable(boolean)}. ``` The property is updated through its shadow node `ReactImageManager` method `setAccessible` https://bit.ly/3dDuK5L ```java * <p>Instances of this class receive property updates from JS via @{link UIManagerModule}. * Subclasses may use {link #updateShadowNode} to persist some of the updated fields in the node * instance that corresponds to a particular view type. ``` ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://github.com/facebook/react-native/wiki/Changelog --> [Android] [Fixed] - adding setAccessible to ReactImageManager to allow screenreader announce Image accessibilityState of "disabled" Pull Request resolved: #31252 Test Plan: **<details><summary>CLICK TO OPEN TESTS RESULTS</summary>** <p> Enable audio to hear the screenreader TEST SCENARIO - The user moves the screenreader focus to an image and the screenreader reads the Image accessibilityLabel "plain network image" RESULT - The screenreader announces the accessibilityState disabled after reading the Image accessibilityLabel "plain network image" ```javascript <Image accessible={true} accessibilityLabel="plain network image" accessibilityState={{disabled: true}} source={fullImage} style={styles.base} /> ``` <video src="https://user-images.githubusercontent.com/24992535/112670432-2f366d00-8e61-11eb-843f-4b56f4a06a91.mp4" width="700" /> </p> </details> Reviewed By: kacieb Differential Revision: D28194597 Pulled By: lunaleaps fbshipit-source-id: 5f89ce5c714405506261885ac6fea2c15c2e1f23
- Loading branch information