Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions main/accessibility.js → accessibility/keyboardui.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { InputManager } from "./inputmanager.js";
import { ContextManager } from "./context.js";
import { translate } from "./translation.js";
import { InputManager } from "../main/inputmanager.js";
import { ContextManager } from "../main/context.js";
import { translate } from "../main/translation.js";
import { SHORTCUTS_HELP_URL } from "../config.js";

// Area menu accessed with Ctrl + B to quickly skip to
Expand All @@ -27,7 +27,6 @@ const AreaManager = {
// Create the element dynamically so you don't have to edit index.html
const div = document.createElement("div");
div.id = "area-menu-overlay";
div.className = "hidden";
div.classList.add("hidden");
div.setAttribute("role", "dialog");
div.setAttribute("aria-modal", "true");
Expand All @@ -43,7 +42,19 @@ const AreaManager = {
if (show) {
GizmoMenuManager.toggle(false); // Close gizmo menu if open
this.renderHighlights();
this._previousInertStates = new Map();
document
.querySelectorAll("body > *:not(#area-menu-overlay)")
.forEach((el) => {
this._previousInertStates.set(el, el.inert);
el.inert = true;
});
this.previousFocus = document.activeElement;
setTimeout(() => this.overlay.focus(), 0);
} else {
this._previousInertStates?.forEach((wasInert, el) => (el.inert = wasInert));
this._previousInertStates = null;
this.previousFocus?.focus();
Comment thread
coderabbitai[bot] marked this conversation as resolved.
}
this.overlay.classList.toggle("hidden", !show);
}
Expand Down Expand Up @@ -475,7 +486,7 @@ const ShortcutsPanel = {
tbody.innerHTML = Object.entries(groups)
.map(
([cat, items]) => `
<tr><th colspan="2">${cat}</th></tr>
<tr><th colspan="2" scope="rowgroup">${cat}</th></tr>
${items.map(({ label, keys }) => `<tr><td>${label}</td><td>${formatKeys(keys)}</td></tr>`).join("")}
`,
)
Expand Down
2 changes: 1 addition & 1 deletion main/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import {
initializeSavedLanguage,
translate,
} from "./translation.js";
import { ShortcutsPanel } from "./accessibility.js";
import { ShortcutsPanel } from "../accessibility/keyboardui.js";
import { InputManager } from "./inputmanager.js";
import "./context.js";

Expand Down
2 changes: 1 addition & 1 deletion ui/addmenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
setCrosshairCursor,
setDefaultCursor,
} from "./canvas-utils.js";
import { GizmoMenuManager } from "../main/accessibility.js";
import { GizmoMenuManager } from "../accessibility/keyboardui.js";

const colorFields = {
HAIR_COLOR: "#000000", // Hair: black
Expand Down
2 changes: 1 addition & 1 deletion ui/gizmos.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import {
} from "./canvas-utils.js";
import { createAxisKeyboardHandler } from "./axis-keyboard.js";
import { InputManager } from "../main/inputmanager.js";
import { GizmoMenuManager } from "../main/accessibility.js";
import { GizmoMenuManager } from "../accessibility/keyboardui.js";
export let gizmoManager;

// Enable debug messages
Expand Down
Loading