Commit 805d328b authored by Esmael El-Moslimany's avatar Esmael El-Moslimany Committed by Commit Bot

Settings WebUI: cr-link-row, removing focus/ripple on click in label

Bug: 943480
Change-Id: I3988474e822ce29e5e16eb15b089a85f6345b171
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1529409Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Commit-Queue: Esmael El-Moslimany <aee@chromium.org>
Cr-Commit-Position: refs/heads/master@{#642321}
parent fd6d0810
......@@ -54,16 +54,17 @@ Polymer({
},
listeners: {
blur: 'hideRipple',
blur: 'hideRipple_',
click: 'onClick_',
down: 'onDown_',
focus: 'showRipple_',
keydown: 'onKeyDown_',
keyup: 'onKeyUp_',
up: 'hideRipple',
up: 'hideRipple_',
},
hideRipple: function() {
/** @private */
hideRipple_: function() {
this.getRipple().holdDown = false;
},
......
......@@ -45,11 +45,6 @@ Polymer({
ariaDescribedBy_: String,
},
listeners: {
down: 'onDown_',
up: 'onUp_',
},
/** @type {boolean} */
get noink() {
return this.$.icon.noink;
......@@ -64,28 +59,6 @@ Polymer({
this.$.icon.focus();
},
/** @private */
onDown_: function() {
// If the icon has focus, we want to preemptively blur it. Otherwise it will
// be blurred immediately after gaining focus. The ripple will either
// disappear when the mouse button is held down or the ripple will not
// be rendered. This is an issue only when the cr-link-row is clicked, not
// the icon itself.
if (this.shadowRoot.activeElement == this.$.icon) {
this.$.icon.blur();
}
// When cr-link-row is click, <body> will gain focus after the down event is
// handled. We need to wait until the next task to focus on the icon.
setTimeout(() => {
this.focus();
});
},
/** @private */
onUp_: function() {
this.$.icon.hideRipple();
},
/** @private */
getIconClass_: function() {
return this.external ? 'icon-external' : 'subpage-arrow';
......
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