material-components-android
material-components-android copied to clipboard
[Slider] ContentDescription causes the talkback to not read correctly
Description: When we add a content description to the view talkback announces the slider without the ability to interact with the slider. So you need to swipe to the right to go inside of the slider to interact with talkback
Without content description it announces like this: 0 % slider use volume keys to adjust With content description it seems to putting that on a root view which does not have access to adjust. Example: [Content Desc Text] Slider double tap to activate If I double tap nothing happens If I swipe right it will go inside and announce the slider properly 0% [Content Desc Text] Slider
It is recommended to set content description here https://material.io/components/sliders/android#continuous-slider
Expected behavior: It should not add the wrapping slider in talkback that is not interactable. It should just announce as 0% [Content Desc Text] Slider
Source code:
<com.google.android.material.slider.Slider android:id="@+id/slider" android:layout_width="match_parent" android:layout_height="wrap_content" android:stepSize="1.0" android:contentDescription="Zero" android:valueTo="5.0" />
Android API version: 30 Android 11
Material Library version: 1.4.0
Device: Pixel 5
To help us triage faster, please check to make sure you are using the latest version of the library.
We also happily accept pull requests.
Hi, i have the same problem, any updates? @DavidCorrado
@DavidCorrado, just curious, what was your workaround with the slider in this case?
As noted in #2347 , the labelFor mechanism is also tied to this surrounding, non-interactable wrapper.
How I resolved this was copy the full slider code and override the code with accessibility to read as I wanted. Which is essentially just adding the label to what talk back announces. So I didn't use content description at all.
Hi ! Any update about this issue ? Thanks Regards
Hello +1 here, still having this issue while implementing accessibility
How I resolved this was copy the full slider code and override the code with accessibility to read as I wanted. Which is essentially just adding the label to what talk back announces. So I didn't use content description at all.
Could you include a gist of what you had done?
This RangeSlider is still a not accessible mess.