Commit 699a9816 authored by Esmael El-Moslimany's avatar Esmael El-Moslimany Committed by Commit Bot

WebUI: cr-slider, make knob not focusable when disabled

Bug: 906009
Change-Id: Ic3ad0336522415492c043bc125ced0fa5796f169
Reviewed-on: https://chromium-review.googlesource.com/c/1341059Reviewed-by: default avatarScott Chen <scottchen@chromium.org>
Commit-Queue: Esmael El-Moslimany <aee@chromium.org>
Cr-Commit-Position: refs/heads/master@{#609061}
parent f318fc43
...@@ -56,6 +56,7 @@ cr_slider.SliderTick; ...@@ -56,6 +56,7 @@ cr_slider.SliderTick;
type: Boolean, type: Boolean,
computed: 'computeDisabled_(disabled, ticks.*)', computed: 'computeDisabled_(disabled, ticks.*)',
reflectToAttribute: true, reflectToAttribute: true,
observer: 'onDisabledChanged_',
}, },
dragging: { dragging: {
...@@ -249,6 +250,12 @@ cr_slider.SliderTick; ...@@ -249,6 +250,12 @@ cr_slider.SliderTick;
this.holdDown_ = false; this.holdDown_ = false;
}, },
/** @private */
onDisabledChanged_: function() {
this.$.knob.setAttribute('tabindex', this.disabled_ ? '-1' : '0');
this.blur();
},
/** @private */ /** @private */
onFocus_: function() { onFocus_: function() {
this.holdDown_ = true; this.holdDown_ = true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment