-
Notifications
You must be signed in to change notification settings - Fork 24.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In native code, there is no way to determine unset selected
vs selected: false
#46988
Comments
|
|
selected
vs selected: false
|
@chiaramooney Is this issue happening only on Windows? Or is it consistent across platforms? |
@shubhamguptadream11 Consistent across platforms! |
Hi @chiaramooney , I'm would love to tackle this issue. |
Great thank you! The first option you presented of moving the type to be std::optional would be great. This way |
Description
From the JS, the developer has the choice to specify the
accessibilityState
prop. Then, they can specify any subset of 'busy', 'expanded', 'selected', 'disabled', and 'checked'.In the JS `selected' can be undefined or a boolean value. However, once the data is passed to the native code, accessibilityState->selected always takes a boolean value. There is no way to determine in the native code if the user has not set the 'selected' state (i.e. the control does not have selectable behavior) or if they have set 'selected' to false (i.e. the control does have selectable behavior but it is not selected)
Could we change the 'selected' value in the accessibilityState to be an std::optional, so the 'undefined' state of
selected
could be preserved on the native side? This change is needed to implement correct accessibility behavior on Windows.Steps to reproduce
Set a control to have accessibilityState={{}} and accessibilityState={{selected: false}}. Both show the same data for props->accessibilityState
React Native Version
nightly
Affected Platforms
Other (please specify)
Output of
npx react-native info
Stacktrace or Logs
Reproducer
https://snack.expo.dev/5HM2iIVtfaUY5z1FeHDgm
Screenshots and Videos
No response
The text was updated successfully, but these errors were encountered: