diff --git a/frontend/src/ts/commandline/commandline.ts b/frontend/src/ts/commandline/commandline.ts index dac9c13593af..f76a33b3d3f9 100644 --- a/frontend/src/ts/commandline/commandline.ts +++ b/frontend/src/ts/commandline/commandline.ts @@ -64,7 +64,7 @@ function removeCommandlineBackground(): void { function addCommandlineBackground(): void { qs("#commandLine")?.removeClass("noBackground"); - if (Config.showOutOfFocusWarning && !isInputElementFocused()) { + if (!isInputElementFocused()) { OutOfFocus.show(); } } diff --git a/frontend/src/ts/pages/account-settings.ts b/frontend/src/ts/pages/account-settings.ts index 2ff8344c9357..ab7ea2378da8 100644 --- a/frontend/src/ts/pages/account-settings.ts +++ b/frontend/src/ts/pages/account-settings.ts @@ -34,9 +34,9 @@ const state: State = { }; function updateAuthenticationSections(): void { - pageElement.qs(".section.passwordAuthSettings button")?.addClass("hidden"); - pageElement.qs(".section.googleAuthSettings button")?.addClass("hidden"); - pageElement.qs(".section.githubAuthSettings button")?.addClass("hidden"); + pageElement.qsa(".section.passwordAuthSettings button")?.addClass("hidden"); + pageElement.qsa(".section.googleAuthSettings button")?.addClass("hidden"); + pageElement.qsa(".section.githubAuthSettings button")?.addClass("hidden"); const user = getAuthenticatedUser(); if (user === null) return; diff --git a/frontend/src/ts/test/out-of-focus.ts b/frontend/src/ts/test/out-of-focus.ts index 4b153568dc24..5a9050583954 100644 --- a/frontend/src/ts/test/out-of-focus.ts +++ b/frontend/src/ts/test/out-of-focus.ts @@ -1,4 +1,5 @@ import * as Misc from "../utils/misc"; +import Config from "../config"; const outOfFocusTimeouts: (number | NodeJS.Timeout)[] = []; @@ -11,6 +12,7 @@ export function hide(): void { } export function show(): void { + if (!Config.showOutOfFocusWarning) return; outOfFocusTimeouts.push( setTimeout(() => { $("#words, #compositionDisplay") diff --git a/frontend/src/ts/test/test-ui.ts b/frontend/src/ts/test/test-ui.ts index a65de58d185c..f7422084f4e8 100644 --- a/frontend/src/ts/test/test-ui.ts +++ b/frontend/src/ts/test/test-ui.ts @@ -465,7 +465,7 @@ function updateWordWrapperClasses(): void { void updateHintsPositionDebounced(); Caret.updatePosition(); - if (document.activeElement !== getInputElement()) { + if (!isInputElementFocused()) { OutOfFocus.show(); } } @@ -1998,7 +1998,7 @@ $("#wordsInput").on("focus", (e) => { }); $("#wordsInput").on("focusout", () => { - if (!TestState.resultVisible && Config.showOutOfFocusWarning) { + if (!isInputElementFocused()) { OutOfFocus.show(); } Caret.hide();