Merge pull request #315 from AMoo-Miki/fix-version-selector-safari

Fix version-selector in Safari 15.x
This commit is contained in:
Miki 2021-12-06 12:04:25 -08:00 committed by GitHub
commit 50fcef8e9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -39,6 +39,11 @@ const tpl = `
background-image: var(--hover-bg);
}
#root:focus {
outline: none;
}
:host(:not([aria-expanded="true"])) #root:focus,
#root:focus:hover {
box-shadow: 0 0 0 3px rgba(0, 0, 255, 0.25);
}
@ -136,7 +141,7 @@ class VersionSelector extends HTMLElement {
constructor() {
super();
this.attachShadow({mode: 'open'});
this.attachShadow({mode: 'open', delegatesFocus: true});
this._onBlur = (e => {
this._expand(false);
this.removeEventListener('blur', this._onBlur);