Skip to content

When a control updates its accessibilityRole shows as an empty string #13858

Open

Description

Problem Description

If a control has a specified accessibilityRole, the role will correctly be seen in the control's BaseViewProps upon the control's first render. But any time the control needs to rerender (i.e. when a switch is toggled, a touchable runs an onPress action that changes its text, a TextInput's text is edited, etc), the accessibilityRole for the control's BaseViewProps becomes the empty string. The role data is no longer correctly being added to the control's BaseViewProps.

I've tested other accessibility props and this behavior does not happen. It only occurs with accessibilityRole.

When looking at the RCTPerformMountInstructions function, the newChildShadowView.props object which is used to call the UpdateProps function for each component, the accessibilityRole value is empty as well.

Steps To Reproduce

  1. Run playground-composition
  2. Edit simple.tsx to be a switch with the value and onChange prop specified so the Switch can correctly toggle.
  3. Set the accessibilityRole of the switch to "adjustable"
  4. Launch the app
  5. Open accessibility insights; the control type of the switch should be slider.
  6. Then toggle the switch; reopen accessibility insights to see the control type is now button (the default control type of a switch which is passed to UIA when accessibilityRole = "")

Expected Results

The control type of the Switch should be "slider" before and after the switch is toggled.

CLI version

N/A

Environment

N/A

Community Modules

No response

Target Platform Version

None

Target Device(s)

No response

Visual Studio Version

None

Build Configuration

None

Snack, code example, screenshot, or link to a repository

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

Area: AccessibilityArea: FabricSupport Facebook FabricNew ArchitectureBroad category for issues that apply to the RN "new" architecture of Turbo Modules + FabricWorkstream: AccessibilityEnsure RNW Fabric apps are properly accessible.bug

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions