Skip to content

Commit

Permalink
os settings: Fix aria-disabled bug in settings_slider
Browse files Browse the repository at this point in the history
After updating the disabled status of the settings-slider element, the
ChromeVox still announces the previous status. The issue is that the
aria-disabled attribute is not being passed down to the cr-slider
element.

Before fix:
http://screencast/cast/NjY5NDEwMDczMTQyODg2NHxlMGRiOTQ2MS1iNg
After fix: http://screencast/cast/NjA5MDY4OTA5OTA3MTQ4OHxhODI4OGI3Ny1kNw

In mouse settings, turning off the "Scroll acceleration" button will
enable "Scrolling speed" slider, vise verse. In the screencast before
the fix, in the beginning, "Scroll acceleration" button is on, the
"Scrolling speed" slider is disabled. The ChromeVox announces correctly.
However, after turning off the "Scroll acceleration" button, the
"Scrolling speed" slider is enabled now, but the ChromeVox still
announces it as disabled.

In the screencast after the fix, the ChromeVox always announces the
slider status correctly.

Bug: b:295022565, b:292079653
Test: Verified in DUT
Change-Id: I23c4c4a454899139dea33a2c2b6829b0252091f1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4769507
Commit-Queue: Wenyu Zhang <zhangwenyu@google.com>
Reviewed-by: Kyle Horimoto <khorimoto@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1182617}
  • Loading branch information
wenyu zhang authored and Chromium LUCI CQ committed Aug 11, 2023
1 parent 85843b0 commit 18a3baf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@
min="[[min]]" on-dragging-changed="onSliderChanged_"
on-updating-from-key="onSliderChanged_"
aria-roledescription$="[[getRoleDescription_()]]"
aria-label$="[[labelAria]]">
aria-label$="[[labelAria]]"
aria-disabled="[[ariaDisabled]]">
</cr-slider>
<!-- aria-hidden because role description on #slider contains min/max. -->
<div id="labels" disabled$="[[disableSlider_]]" aria-hidden="true">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ export class SettingsSliderElement extends SettingsSliderElementBase {

disabled: Boolean,

// The value of ariaDisabled should only be "true" or "false".
ariaDisabled: String,

showMarkers: Boolean,

disableSlider_: {
Expand Down Expand Up @@ -111,6 +114,8 @@ export class SettingsSliderElement extends SettingsSliderElementBase {
updateValueInstantly: boolean;
private loaded_: boolean;

override ariaDisabled: string;

override connectedCallback() {
super.connectedCallback();

Expand Down

0 comments on commit 18a3baf

Please sign in to comment.