mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fix string comparison when self has accessibility order reference (#51270)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/51270 I was informed that we could not reference ourselves with accessibility order when using `useID`. The reason for that ended up being because of this if statement which uses `==`. Note this worked with a normal string like `"foo"` but `useID` has ids like `"<<r0>>"` so I imagine the < and > made this break. Changelog: [Internal] Reviewed By: sammy-SC Differential Revision: D74601689 fbshipit-source-id: 25adc84248fbfcaff36607d18c170e6c8000cffb
This commit is contained in:
committed by
Facebook GitHub Bot
parent
af4cfbf03f
commit
d362e496eb
+1
-1
@@ -1161,7 +1161,7 @@ static RCTBorderStyle RCTBorderStyleFromOutlineStyle(OutlineStyle outlineStyle)
|
||||
for (auto childId : _props->accessibilityOrder) {
|
||||
NSString *nsStringChildId = RCTNSStringFromString(childId);
|
||||
// Special case to allow for self-referencing with accessibilityOrder
|
||||
if (nsStringChildId == self.nativeId) {
|
||||
if ([nsStringChildId isEqualToString:self.nativeId]) {
|
||||
if (!_axElementDescribingSelf) {
|
||||
_axElementDescribingSelf = [[RCTViewAccessibilityElement alloc] initWithView:self];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user