material-components-android icon indicating copy to clipboard operation
material-components-android copied to clipboard

[Slider] ContentDescription causes the talkback to not read correctly

Open DavidCorrado opened this issue 3 years ago • 7 comments

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.

DavidCorrado avatar Aug 30 '21 16:08 DavidCorrado

Hi, i have the same problem, any updates? @DavidCorrado

lmaths avatar Oct 06 '21 17:10 lmaths

@DavidCorrado, just curious, what was your workaround with the slider in this case?

xtstoll avatar Oct 06 '21 21:10 xtstoll

As noted in #2347 , the labelFor mechanism is also tied to this surrounding, non-interactable wrapper.

josefigueroa168 avatar Oct 07 '21 14:10 josefigueroa168

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.

DavidCorrado avatar Oct 07 '21 19:10 DavidCorrado

Hi ! Any update about this issue ? Thanks Regards

FannyDemey avatar Feb 18 '22 12:02 FannyDemey

Hello +1 here, still having this issue while implementing accessibility

willgzn avatar Aug 23 '22 12:08 willgzn

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?

asdfff711 avatar Sep 07 '22 00:09 asdfff711

This RangeSlider is still a not accessible mess.

sandykouker avatar Apr 21 '23 15:04 sandykouker