Skip to content

Commit 28878a2

Browse files
committed
fix(iOS): apply accessibility props to the indicator in ActivityIndicator
The accessibility props of ActivityIndicator went to the host view, which is not an accessibility element, so VoiceOver read the inner UIActivityIndicatorView with its default label. Return the indicator from accessibilityElement, as RCTSwitchComponentView does for UISwitch.
1 parent 05a2e4c commit 28878a2

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎packages/react-native/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.mm‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,18 @@ - (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared &
9191
[super updateProps:props oldProps:oldProps];
9292
}
9393

94+
// UIActivityIndicatorView is the accessibility element, not this view, so the
95+
// accessibility props go to it.
96+
- (BOOL)isAccessibilityElement
97+
{
98+
return NO;
99+
}
100+
101+
- (NSObject *)accessibilityElement
102+
{
103+
return _activityIndicatorView;
104+
}
105+
94106
@end
95107

96108
Class<RCTComponentViewProtocol> RCTActivityIndicatorViewCls(void)

0 commit comments

Comments
 (0)