Skip to content

Commit 841a4ca

Browse files
jorge-cabfacebook-github-bot
authored andcommitted
Make experimental_accessibilityOrder a View prop only (#52056)
Summary: Pull Request resolved: #52056 This prop should only be used on Views using it in Text is not very intuitive and also would require some unnecessary edge case handling on Android which we now also remove Changelog: [Internal] Reviewed By: joevilches Differential Revision: D76744972
1 parent 5348f9f commit 841a4ca

File tree

4 files changed

+8
-13
lines changed

4 files changed

+8
-13
lines changed

packages/react-native/Libraries/Components/View/ViewAccessibility.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -374,13 +374,6 @@ export type AccessibilityProps = $ReadOnly<{
374374
*/
375375
'aria-label'?: ?Stringish,
376376

377-
/**
378-
* Defines the order in which descendant elements receive accessibility focus.
379-
* The elements in the array represent nativeID values for the respective
380-
* descendant elements.
381-
*/
382-
experimental_accessibilityOrder?: ?Array<string>,
383-
384377
/**
385378
* Indicates to accessibility services to treat UI component like a specific role.
386379
*/

packages/react-native/Libraries/Components/View/ViewPropTypes.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,13 @@ type ViewBaseProps = $ReadOnly<{
490490
* See https://reactnative.dev/docs/view#removeclippedsubviews
491491
*/
492492
removeClippedSubviews?: ?boolean,
493+
494+
/**
495+
* Defines the order in which descendant elements receive accessibility focus.
496+
* The elements in the array represent nativeID values for the respective
497+
* descendant elements.
498+
*/
499+
experimental_accessibilityOrder?: ?Array<string>,
493500
}>;
494501

495502
export type ViewProps = $ReadOnly<{

packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3685,7 +3685,6 @@ export type AccessibilityProps = $ReadOnly<{
36853685
accessibilityLabel?: ?Stringish,
36863686
accessibilityHint?: ?Stringish,
36873687
\\"aria-label\\"?: ?Stringish,
3688-
experimental_accessibilityOrder?: ?Array<string>,
36893688
accessibilityRole?: ?AccessibilityRole,
36903689
role?: ?Role,
36913690
accessibilityState?: ?AccessibilityState,
@@ -3833,6 +3832,7 @@ type ViewBaseProps = $ReadOnly<{
38333832
hitSlop?: ?EdgeInsetsOrSizeProp,
38343833
pointerEvents?: ?(\\"auto\\" | \\"box-none\\" | \\"box-only\\" | \\"none\\"),
38353834
removeClippedSubviews?: ?boolean,
3835+
experimental_accessibilityOrder?: ?Array<string>,
38363836
}>;
38373837
export type ViewProps = $ReadOnly<{
38383838
...DirectEventProps,

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactAccessibilityDelegate.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import android.view.ViewGroup;
1818
import android.view.accessibility.AccessibilityEvent;
1919
import android.widget.EditText;
20-
import android.widget.TextView;
2120
import androidx.annotation.NonNull;
2221
import androidx.annotation.Nullable;
2322
import androidx.core.view.ViewCompat;
@@ -501,10 +500,6 @@ protected void onPopulateNodeForVirtualView(
501500
node.setContentDescription(mView.getContentDescription());
502501
}
503502

504-
if (mView instanceof TextView && ((TextView) mView).getText() != null) {
505-
node.setText(((TextView) mView).getText());
506-
}
507-
508503
populateAccessibilityNodeInfo(mView, node);
509504
node.setBoundsInParent(new Rect(0, 0, mView.getWidth(), mView.getHeight()));
510505
} else {

0 commit comments

Comments
 (0)