Skip to content

Commit 6b3bdca

Browse files
jorge-cabfacebook-github-bot
authored andcommitted
Make experimental_accessibilityOrder a View prop only, Split of "[rn][Android] Fix View Coopting View edge case on Android"
Differential Revision: D76744972
1 parent 89401b7 commit 6b3bdca

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
@@ -234,4 +234,11 @@ export interface ViewProps
234234
* `collapsable={false}` on each child.
235235
*/
236236
collapsableChildren?: boolean | undefined;
237+
238+
/**
239+
* Defines the order in which descendant elements receive accessibility focus.
240+
* The elements in the array represent nativeID values for the respective
241+
* descendant elements.
242+
*/
243+
experimental_accessibilityOrder?: Array<string> | undefined;
237244
}

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/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)