[250] Overlay-Dialoge: Fokus, Tab-Falle und Fokus-Rückkehr über useModalFocus, Namen für unbeschriftete Felder

This commit is contained in:
Claude committed 2026-11-13 23:59:25 +00:00
1 parent 318a7796de
commit ba70797dd5
20 files changed
+169 -23

No files matched your search

+3 -1
View File
@@ -11,6 +11,7 @@
import { useEffect, useRef, useState } from "react";
import { t } from "../i18n";
import { useModalFocus } from "./modalFocus";
import { geocode, fetchBuildings } from "../io/swissTopo";
import type { GeocodeCandidate } from "../io/swissTopo";
import { fetchBuildings3d } from "../io/swissBuildings3d";
@@ -102,6 +103,7 @@ export function ContextImportDialog({
onSetGeoAnchor,
windowed = false,
}: ContextImportDialogProps) {
const dialogRef = useModalFocus({});
useEffect(() => {
const onKey = (e: KeyboardEvent) => {
if (e.key === "Escape") onClose();
@@ -357,7 +359,7 @@ export function ContextImportDialog({
const dialog = (
<div
className={`imp-dialog${windowed ? " imp-dialog-embedded" : ""}`}
role="dialog"
ref={dialogRef} role="dialog"
aria-modal="true"
aria-label={t("ctxImport.title")}
onClick={windowed ? undefined : (e) => e.stopPropagation()}