mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fix testID propogation in Fabric (#45379)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/45379 Fixes an accessibility issue where these values weren't being propogated for RCTTextInputComponentView See facebook/react-native#38709 Changelog: [iOS] [Fixed] - testID wasn't propogating to accessibilityIdentifier Reviewed By: cipolleschi Differential Revision: D59594049 fbshipit-source-id: 89ec15f92b423b6e18b1a5eb9d32fc4013c039ba
This commit is contained in:
committed by
Facebook GitHub Bot
parent
193cdc36f7
commit
ab485c6a94
+8
-1
@@ -388,7 +388,14 @@ using namespace facebook::react;
|
||||
|
||||
// `testId`
|
||||
if (oldViewProps.testId != newViewProps.testId) {
|
||||
self.accessibilityIdentifier = RCTNSStringFromString(newViewProps.testId);
|
||||
SEL setAccessibilityIdentifierSelector = @selector(setAccessibilityIdentifier:);
|
||||
NSString *identifier = RCTNSStringFromString(newViewProps.testId);
|
||||
if ([self.accessibilityElement respondsToSelector:setAccessibilityIdentifierSelector]) {
|
||||
UIView *accessibilityView = (UIView *)self.accessibilityElement;
|
||||
accessibilityView.accessibilityIdentifier = identifier;
|
||||
} else {
|
||||
self.accessibilityIdentifier = identifier;
|
||||
}
|
||||
}
|
||||
|
||||
// `filter`
|
||||
|
||||
Reference in New Issue
Block a user