Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
fb01b49e
Commit
fb01b49e
authored
Nov 02, 2025
by
Claude
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: add VisuallyHidden component and enhance LocationDialog accessibility
parent
638b22a2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
2 deletions
+30
-2
LocationDialog.tsx
...nts/MemoEditor/ActionButton/InsertMenu/LocationDialog.tsx
+11
-2
visually-hidden.tsx
web/src/components/ui/visually-hidden.tsx
+19
-0
No files found.
web/src/components/MemoEditor/ActionButton/InsertMenu/LocationDialog.tsx
View file @
fb01b49e
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
(
<
Dialog
open=
{
open
}
onOpenChange=
{
onOpenChange
}
>
<
DialogContent
className=
"max-w-[min(28rem,calc(100vw-2rem))] !p-0"
>
<
DialogClose
className=
"hidden"
></
DialogClose
>
<
VisuallyHidden
>
<
DialogClose
/>
</
VisuallyHidden
>
<
VisuallyHidden
>
<
DialogTitle
>
{
t
(
"tooltip.select-location"
)
}
</
DialogTitle
>
</
VisuallyHidden
>
<
VisuallyHidden
>
<
DialogDescription
>
Select a location on the map or enter coordinates manually
</
DialogDescription
>
</
VisuallyHidden
>
<
div
className=
"flex flex-col"
>
<
div
className=
"w-full h-64 overflow-hidden rounded-t-md bg-muted/30"
>
<
LeafletMap
key=
{
JSON
.
stringify
(
locationInitialized
)
}
latlng=
{
position
}
onChange=
{
onPositionChange
}
/>
...
...
web/src/components/ui/visually-hidden.tsx
0 → 100644
View file @
fb01b49e
import
*
as
React
from
"react"
;
export
const
VisuallyHidden
=
React
.
forwardRef
<
HTMLSpanElement
,
React
.
HTMLAttributes
<
HTMLSpanElement
>>
(({
children
,
...
props
},
ref
)
=>
{
return
(
<
span
ref=
{
ref
}
className=
"absolute w-px h-px p-0 -m-px overflow-hidden whitespace-nowrap border-0"
style=
{
{
clip
:
"rect(0, 0, 0, 0)"
,
clipPath
:
"inset(50%)"
,
}
}
{
...
props
}
>
{
children
}
</
span
>
);
});
VisuallyHidden
.
displayName
=
"VisuallyHidden"
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment