Skip to content
12 changes: 7 additions & 5 deletions frontend/src/styles/test.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1626,14 +1626,16 @@
}

main.focus .pageTest {
#testModesNotice {
opacity: 0 !important;
}
#testConfig {
#testModesNotice,
#testConfig,
#mobileTestConfigButton {
opacity: 0 !important;
}
#mobileTestConfigButton {
#restartTestButton {
opacity: 0 !important;
&:focus-visible {
opacity: 1 !important;
}
}
}

Expand Down
3 changes: 2 additions & 1 deletion frontend/src/ts/components/layout/header/Nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ export function Nav(): JSXElement {
<div
class={cn(
"relative",
"hover:**:data-[ui-element='accountMenu']:pointer-events-auto hover:**:data-[ui-element='accountMenu']:opacity-100",
!getFocus() &&
"hover:**:data-[ui-element='accountMenu']:pointer-events-auto hover:**:data-[ui-element='accountMenu']:opacity-100",
"has-focus-visible:**:data-[ui-element='accountMenu']:pointer-events-auto has-focus-visible:**:data-[ui-element='accountMenu']:opacity-100",
)}
>
Expand Down
7 changes: 3 additions & 4 deletions frontend/src/ts/test/focus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ let cache: {
function initializeCache(): void {
if (cacheReady) return;

const cursorSelector = "body, button, a";
const elementsSelector = [
"app",
"footer",
Expand All @@ -33,7 +32,6 @@ function initializeCache(): void {
"#ad-footer-small-wrapper",
].join(",");

cache.cursor = qsa(cursorSelector);
cache.focus = qsa(elementsSelector);

cacheReady = true;
Expand All @@ -44,6 +42,7 @@ function initializeCache(): void {
export function set(value: boolean, withCursor = false): void {
requestDebouncedAnimationFrame("focus.set", () => {
initializeCache();
cache.cursor = qsa("body, button, a");

if (value && !getFocus()) {
setFocus(true);
Expand All @@ -52,7 +51,7 @@ export function set(value: boolean, withCursor = false): void {
if (cache.focus) {
cache.focus.addClass("focus");
}
if (!withCursor && cache.cursor) {
if (!withCursor && cache.cursor !== undefined) {
cache.cursor.setStyle({ cursor: "none" });
}

Expand All @@ -67,7 +66,7 @@ export function set(value: boolean, withCursor = false): void {
if (cache.focus) {
cache.focus.removeClass("focus");
}
if (cache.cursor) {
if (cache.cursor !== undefined) {
cache.cursor.setStyle({ cursor: "" });
}

Expand Down