Skip to content

Commit 6742622

Browse files
jorge-cabfacebook-github-bot
authored andcommitted
Fix View Coopting View edge case on Android
Summary: Before, to disable views that were excluded from the order we were setting them to be not important for accessibility. This however breaks coopting behavior of parent views, because parent views will not announce content descriptions of children that are not important for accessibility. Instead of disabling by setting `important for accessibility = no` now we just set `isFocusable = false` which disables focusing but still allows parent views to coopt Changelog: [Internal] Differential Revision: D76745057
1 parent 6b3bdca commit 6742622

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactAxOrderHelper.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ package com.facebook.react.uimanager
1010
import android.graphics.Rect
1111
import android.view.View
1212
import android.view.ViewGroup
13-
import android.widget.TextView
1413
import com.facebook.react.R
1514
import com.facebook.react.bridge.ReadableArray
1615

@@ -76,8 +75,8 @@ private object ReactAxOrderHelper {
7675
}
7776
}
7877

79-
if (!isIncluded && !isContained && parent != view && view !is TextView) {
80-
view.importantForAccessibility = View.IMPORTANT_FOR_ACCESSIBILITY_NO
78+
if (!isIncluded && !isContained && parent != view) {
79+
view.isFocusable = false
8180
}
8281

8382
// Don't traverse the children of a nested accessibility order

0 commit comments

Comments
 (0)