Skip to content

Commit ca01290

Browse files
Ziqi Chenfacebook-github-bot
Ziqi Chen
authored andcommitted
changed prop name currentViewStates to AccessibilityStates on iOS (3/3)
Summary: Context: After discussing with yungsters, `currentViewStates` is a very ambiguous name for a prop, especially because there are only two possible values. From a developer's perspective, it makes more sense to just call them `accessibilityStates` because the main use for them is to add states to Talkback and Voiceover. Also, the actual implementation of what we're changing under the hood in Native Code is abstracted away from developers using React Native, so as long as behavior is as they would expect, it makes more sense to change the name into a clear one. Changes in this Diff: Renamed the view property exposed to native iOS code from `currentViewStates` to `accessibilityStates` Also deleted setting the userInteractionEnabled view property, because we want to keep it as just an accessibility property. Reviewed By: PeteTheHeat Differential Revision: D8896821 fbshipit-source-id: 95674c9b7295f5b9e60994c297acdee83f6226d7
1 parent 3bedc78 commit ca01290

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

React/Views/RCTViewManager.m

+2-7
Original file line numberDiff line numberDiff line change
@@ -153,14 +153,9 @@ - (RCTShadowView *)shadowView
153153
view.reactAccessibilityElement.accessibilityTraits |= json ? [RCTConvert UIAccessibilityTraits:json] : defaultView.accessibilityTraits;
154154
}
155155

156-
RCT_CUSTOM_VIEW_PROPERTY(currentViewStates, UIAccessibilityTraits, RCTView)
156+
RCT_CUSTOM_VIEW_PROPERTY(accessibilityStates, UIAccessibilityTraits, RCTView)
157157
{
158-
UIAccessibilityTraits traits = json ? [RCTConvert UIAccessibilityTraits:json] : defaultView.accessibilityTraits;
159-
view.reactAccessibilityElement.accessibilityTraits |= traits;
160-
if (traits == UIAccessibilityTraitNotEnabled || traits == (UIAccessibilityTraitNotEnabled | UIAccessibilityTraitSelected))
161-
{
162-
view.userInteractionEnabled = NO;
163-
}
158+
view.reactAccessibilityElement.accessibilityTraits |= json ? [RCTConvert UIAccessibilityTraits:json] : defaultView.accessibilityTraits;
164159
}
165160

166161
RCT_CUSTOM_VIEW_PROPERTY(pointerEvents, RCTPointerEvents, RCTView)

0 commit comments

Comments
 (0)