You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 81a882b
Browse filesBrowse the repository at this point in the historyBrowse files
Keep focusable={false} Android text out of keyboard navigation
A Text with onPress or onLongPress is accessible, so setAccessible made
it focusable, and a hardware keyboard's Tab, Shift+Tab and arrow keys
stopped on it. Text had no focusable prop to take it out, so a pressable
label between two inputs was always an extra keyboard stop.
The text view managers now collect accessible, focusable,
screenReaderFocusable and importantForAccessibility in the FocusProps
#59048 gives View, and ReactTextView and PreparedLayoutTextView apply
them after each transaction: isFocusable follows focusable, and
accessible while focusable is unset, and an accessible text that
keyboard navigation passes over stays one accessibility element through
screenReaderFocusable. FocusProps gains applyTo and onFocusChanged,
which ReactViewGroup now calls in place of its own copy of them.
A selectable text stays focusable, and so does a ReactTextView whose
dataDetectorType detects links while focusable is unset, as TextView
keeps them. setTextIsSelectable, which ReactTextView calls on every
attach, and setMovementMethod rewrite the view's focusability, so
ReactTextView applies its focus props again after each.
On Android a Paragraph's KeyboardFocusable trait takes the same rule,
counting detected links only outside enablePreparedTextLayout, since
PreparedLayoutTextView detects none, so a scroll view's focus search,
which FocusOrderingHelper answers from that trait, agrees with the text
view. TextProps and the legacy Text types declare the prop; the base
view config already sends it.
ReactAndroid.api gains ReactTextView.onInitializeAccessibilityNodeInfo,
ReactTextViewManager.setFocusable, and ReactTextViewManager's
setImportantForAccessibility and setScreenReaderFocusable overrides.
Copy file name to clipboardExpand all lines: packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/PreparedLayoutTextViewManager.kt
0 commit comments