Skip to content

Commit a1899e9

Browse files
committed
fix: focus ring on chrome-range input element
1 parent ec40814 commit a1899e9

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/js/media-chrome-range.js

+3-9
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,6 @@ template.innerHTML = `
5555
pointer-events: auto;
5656
}
5757
58-
/*
59-
Only show outline when keyboard focusing.
60-
https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo
61-
*/
62-
:host-context([media-keyboard-control]):host(:focus),
63-
:host-context([media-keyboard-control]):host(:focus-within) {
64-
box-shadow: inset 0 0 0 2px rgba(27, 127, 204, 0.9);
65-
}
66-
6758
:host(:hover) {
6859
background: var(--media-control-hover-background, rgba(50,50,60, 0.7));
6960
}
@@ -113,6 +104,9 @@ template.innerHTML = `
113104
/* Eventually want to move towards different styles for focus-visible
114105
https://github.com/WICG/focus-visible/blob/master/src/focus-visible.js
115106
Youtube appears to do this by de-focusing a button after a button click */
107+
input[type=range]:focus-visible {
108+
box-shadow: inset 0 0 0 2px rgba(27, 127, 204, 0.9);
109+
}
116110
input[type=range]:focus {
117111
outline: 0;
118112
}

0 commit comments

Comments
 (0)