Description
Documentation
accessibilityValue documentation: https://reactnative.dev/docs/accessibility#accessibilityvalue
Behavior Explanation
From the documentation:
"Represents the current value of a component. It can be a textual description of a component's value, or for range-based components, such as sliders and progress bars, it contains range information (minimum, current, and maximum).
accessibilityValue is an object. It contains the following fields:
NAME | DESCRIPTION | TYPE | REQUIRED |
---|---|---|---|
min | The minimum value of this component's range. | integer | Required if now is set. |
max | The maximum value of this component's range. | integer | Required if now is set. |
now | The current value of this component's range. | integer | No |
text | A textual description of this component's value. Will override min, now, and max if set. | string | No |
"
On the native side our platform should take the accessibilityValue data and store the data in UIA through the IValueProvider or IRangeValueProvider. The data should then be able to be read aloud through a screen reader.
Implementation Plan
In our native implementation of accessibilityValue we should:
- Check that the control support value or range data.
- Pass the value/range data to the IValueProvider/IRangeValueProvider APIs
Note this prop will be somewhat control type dependent because different controls will store different kinds of data and some may not support value/range data at all.
Past Implementation
Notes
To Be Clarified
It is unclear in documentation what the behavior should be if a control should not support value/range data but an accessibilityValue is supplied. Should the value be ignored, or should the native code add a IValueProvider for the control?