Fix active element

This commit is contained in:
rlauuzo 2024-08-07 12:25:15 +02:00 committed by GitHub
parent 0118007cf2
commit 8bd5dba338
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -178,19 +178,13 @@ const introSkipper = {
overrideBlur(button) { overrideBlur(button) {
if (!button.originalBlur) { if (!button.originalBlur) {
button.originalBlur = button.blur; button.originalBlur = button.blur;
button.blur = () => { button.blur = function() {
if (!button.contains(document.activeElement)) { if (!this.contains(document.activeElement)) {
button.originalBlur(); this.originalBlur();
} }
}; };
} }
}, },
restoreBlur(button) {
if (button.originalBlur) {
button.blur = button.originalBlur;
delete button.originalBlur;
}
},
/** Playback position changed, check if the skip button needs to be displayed. */ /** Playback position changed, check if the skip button needs to be displayed. */
videoPositionChanged() { videoPositionChanged() {
if (!this.skipButton) return; if (!this.skipButton) return;
@ -201,9 +195,12 @@ const introSkipper = {
this.skipButton.classList.remove('show'); this.skipButton.classList.remove('show');
embyButton.addEventListener("transitionend", () => { embyButton.addEventListener("transitionend", () => {
this.skipButton.classList.add("hide"); this.skipButton.classList.add("hide");
this.restoreBlur(embyButton);
embyButton.blur();
this.allowEnter = true; this.allowEnter = true;
if (this.osdVisible()) {
this.osdElement.querySelector('button.btnPause').focus();
} else {
embyButton.originalBlur();
}
}, { once: true }); }, { once: true });
return; return;
} }