Skip to content

Commit 3275685

Browse files
Nick LefeverSaadnajmi
authored andcommitted
[fabric] Copy accessibility attributes when switching TextInput backing view
Summary: This diff adds the copy of the a11y attributes when switching the TextInput to the secure text entry which triggers the switch to a NSSecureTextField and runs the copy of the NSTextField attributes to the new backing text field. Test Plan: - Run Zeratul with Fabric enabled and inspect the Messenger password field on the auth screen using the Accessability Inspector to check that the attributes are passed down to the native text field. {F1332886925} Reviewers: shawndempsey, #rn-desktop Reviewed By: shawndempsey Differential Revision: https://phabricator.intern.facebook.com/D52924480
1 parent bd7408b commit 3275685

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.mm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ void RCTCopyBackedTextInput(
2929
toTextInput.textContainerInset = fromTextInput.textContainerInset;
3030

3131
#if TARGET_OS_OSX // [macOS
32+
toTextInput.accessibilityElement = fromTextInput.accessibilityElement;
33+
toTextInput.accessibilityHelp = fromTextInput.accessibilityHelp;
34+
toTextInput.accessibilityIdentifier = fromTextInput.accessibilityIdentifier;
35+
toTextInput.accessibilityLabel = fromTextInput.accessibilityLabel;
36+
toTextInput.accessibilityRole = fromTextInput.accessibilityRole;
3237
toTextInput.autoresizingMask = fromTextInput.autoresizingMask;
3338
#endif // macOS]
3439
#if TARGET_OS_IOS // [macOS] [visionOS]

0 commit comments

Comments
 (0)