Skip to content

Commit 4e28bce

Browse files
jorge-cabfacebook-github-bot
authored andcommitted
Make experimental_accessibilityOrder a View prop only
Summary: 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] Differential Revision: D76744972
1 parent 3c17e10 commit 4e28bce

File tree

4 files changed

+14
-12
lines changed

4 files changed

+14
-12
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.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,4 +230,11 @@ export interface ViewProps
230230
* `collapsable={false}` on each child.
231231
*/
232232
collapsableChildren?: boolean | undefined;
233+
234+
/**
235+
* Defines the order in which descendant elements receive accessibility focus.
236+
* The elements in the array represent nativeID values for the respective
237+
* descendant elements.
238+
*/
239+
experimental_accessibilityOrder?: Array<string> | undefined;
233240
}

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

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

494501
export type ViewProps = $ReadOnly<{

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)