From fb01b49ecf138a7e1d585a78d6ad9a9527b27985 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 2 Nov 2025 23:02:08 +0800 Subject: [PATCH] feat: add VisuallyHidden component and enhance LocationDialog accessibility --- .../InsertMenu/LocationDialog.tsx | 13 +++++++++++-- web/src/components/ui/visually-hidden.tsx | 19 +++++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 web/src/components/ui/visually-hidden.tsx diff --git a/web/src/components/MemoEditor/ActionButton/InsertMenu/LocationDialog.tsx b/web/src/components/MemoEditor/ActionButton/InsertMenu/LocationDialog.tsx index 8725409b..52c36710 100644 --- a/web/src/components/MemoEditor/ActionButton/InsertMenu/LocationDialog.tsx +++ b/web/src/components/MemoEditor/ActionButton/InsertMenu/LocationDialog.tsx @@ -1,10 +1,11 @@ import { LatLng } from "leaflet"; import LeafletMap from "@/components/LeafletMap"; import { Button } from "@/components/ui/button"; -import { Dialog, DialogClose, DialogContent } from "@/components/ui/dialog"; +import { Dialog, DialogClose, DialogContent, DialogDescription, DialogTitle } from "@/components/ui/dialog"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { Textarea } from "@/components/ui/textarea"; +import { VisuallyHidden } from "@/components/ui/visually-hidden"; import { useTranslate } from "@/utils/i18n"; import { LocationState } from "./types"; @@ -39,7 +40,15 @@ export const LocationDialog = ({ return ( - + + + + + {t("tooltip.select-location")} + + + Select a location on the map or enter coordinates manually +
diff --git a/web/src/components/ui/visually-hidden.tsx b/web/src/components/ui/visually-hidden.tsx new file mode 100644 index 00000000..dcf9ea4f --- /dev/null +++ b/web/src/components/ui/visually-hidden.tsx @@ -0,0 +1,19 @@ +import * as React from "react"; + +export const VisuallyHidden = React.forwardRef>(({ children, ...props }, ref) => { + return ( + + {children} + + ); +}); + +VisuallyHidden.displayName = "VisuallyHidden";