Skip to content

Commit f8dff0b

Browse files
Anda Bereczkyfacebook-github-bot
Anda Bereczky
authored andcommitted
Default accessibility hint is read for buttons
Summary: [Android] [Fixed] - Make sure the default accessibility hint is read for buttons on Android. Reviewed By: PeteTheHeat Differential Revision: D16974987 fbshipit-source-id: e7b932041f82d41271d9393e651967789c05f38a
1 parent 3b3c95b commit f8dff0b

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactAccessibilityDelegate.java

+3
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,9 @@ public static void setRole(
290290
} else if (role.equals(AccessibilityRole.IMAGEBUTTON)) {
291291
nodeInfo.setRoleDescription(context.getString(R.string.imagebutton_description));
292292
nodeInfo.setClickable(true);
293+
} else if (role.equals(AccessibilityRole.BUTTON)) {
294+
nodeInfo.setRoleDescription(context.getString(R.string.button_description));
295+
nodeInfo.setClickable(true);
293296
} else if (role.equals(AccessibilityRole.SUMMARY)) {
294297
nodeInfo.setRoleDescription(context.getString(R.string.summary_description));
295298
} else if (role.equals(AccessibilityRole.HEADER)) {

ReactAndroid/src/main/res/views/uimanager/values/strings_unlocalized.xml

+4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
name="image_description"
1313
translatable="false"
1414
>Image</string>
15+
<string
16+
name="button_description"
17+
translatable="false"
18+
>Button</string>
1519
<string
1620
name="imagebutton_description"
1721
translatable="false"

0 commit comments

Comments
 (0)