[249] Tastatur und Fokus in den neuen Dialogen und Leisten: gemeinsame Fokus-Hülle, Fokusring, aria, Hintergrund-Kürzel gesperrt
This commit is contained in:
24 files changed
+862
-103
No files matched your search
@@ -49,6 +49,7 @@ in `ProjectSync`.
|
||||
| `useMouseSelectionHandlers.ts` | Auswahl und Kontextmenü aus Grundriss und 3D |
|
||||
| `useKeyboardShortcuts.ts`, `keyboardShortcuts.ts`, `commandKeys.ts` | Tastenkürzel, Esc/Enter laufender Befehle |
|
||||
| `shortcutOverview.ts`, `shortcutOverviewHook.ts` | [210] Kürzel-Übersicht (Hilfe → Tastaturkürzel …): Liste aus `SHORTCUT_DEFS` und der Befehls-Registry abgeleitet, nichts von Hand gepflegt; Anzeige `ui/ShortcutOverviewDialog.tsx` |
|
||||
| `modalScope.ts` | [249] `isInModalDialog`: Ziele in `aria-modal`-Dialogen gehören dem Dialog, nicht den App-Kürzeln |
|
||||
| `sheetGuides.ts`, `layoutImageActions.ts` | [208] Hilfslinien am Masterlayout und Aktionen für Bilder auf dem Blatt |
|
||||
| `objectSettings.ts` | Taste T / Menü „Objekteinstellungen…" ([195]): öffnet das schwebende Fenster `object-settings` und klappt den passenden Abschnitt der Objekt-Info auf; `mixedValues.ts`: gemeinsamer Wert über die Mehrfachauswahl (abweichend = leer) |
|
||||
| `useDisplayResolvers.ts` | sichtbar, gedimmt, gesperrt je Ebene und Kategorie |
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
// [249] Gehört das Ereignisziel zu einem offenen modalen Dialog (`aria-modal="true"`)? Dann dürfen die App-Kürzel
|
||||
// im Hintergrund (Entf, T, W/A/S/D, Auswahl-Esc …) nicht reagieren: die Taste gehört dem Dialog.
|
||||
|
||||
export function isInModalDialog(target: EventTarget | Element | null): boolean {
|
||||
const el = target as HTMLElement | null;
|
||||
return !!el && typeof el.closest === "function" && el.closest('[aria-modal="true"]') !== null;
|
||||
}
|
||||
@@ -34,13 +34,15 @@ import type { ElementClipboard, ElementSelectionIds, PastedIds } from "../editor
|
||||
import { parseClipboardText, serializeClipboardText } from "../editors/elementClipboardSerialize";
|
||||
import { matchesShortcut, type ShortcutId, type ShortcutOverrides } from "./keyboardShortcuts";
|
||||
import { isolateSelectionLayerCodes, showAllLayerCodes } from "./layerIsolate";
|
||||
import { isInModalDialog } from "./modalScope";
|
||||
import { toggleTraceAction } from "./traceActions";
|
||||
import { joinCurrentSelection } from "./selectionJoin";
|
||||
import { hideSelectionIn3d, showSelectionIn3d, stepActiveFloor } from "./tabNavigation";
|
||||
|
||||
const isEditableTarget = (e: KeyboardEvent): boolean => {
|
||||
const el = e.target as HTMLElement | null;
|
||||
return !!el && (el.tagName === "INPUT" || el.tagName === "TEXTAREA" || el.isContentEditable);
|
||||
// [249] Auch ein Knopf/Text im modalen Dialog gehört dem Dialog, nicht den App-Kürzeln.
|
||||
return !!el && (el.tagName === "INPUT" || el.tagName === "TEXTAREA" || el.isContentEditable || isInModalDialog(el));
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -123,6 +125,8 @@ export function useCommandTabShortcut(
|
||||
if (inInput) {
|
||||
return;
|
||||
}
|
||||
// [249] In einer Werkzeugleiste (3D-Leiste) bleibt Tab die normale Tastaturnavigation zwischen ihren Knöpfen.
|
||||
if ((e.target as HTMLElement | null)?.closest?.('[role="toolbar"]')) return;
|
||||
e.preventDefault();
|
||||
const eng = engineRef.current;
|
||||
if (eng?.isActive() && eng.hasFields()) {
|
||||
@@ -196,6 +200,7 @@ export function useToolNumberShortcuts(
|
||||
if (gripDragInfoRef?.current) return;
|
||||
if (edgeDragInfoRef?.current) return;
|
||||
const el = e.target as HTMLElement | null;
|
||||
if (isInModalDialog(el)) return;
|
||||
const isInput =
|
||||
!!el && (el.tagName === "INPUT" || el.tagName === "TEXTAREA" || el.isContentEditable);
|
||||
if (isInput) {
|
||||
|
||||
Reference in new issue
Block a user