File tree Expand file tree Collapse file tree 1 file changed +5
-11
lines changed
src/components/imageLightbox Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -77,16 +77,12 @@ export function ImageLightbox({
77
77
} ;
78
78
79
79
const handleKeyDown = ( e : React . KeyboardEvent ) => {
80
- if ( e . key === 'Enter' || e . key === ' ' ) {
81
- if ( e . ctrlKey || e . metaKey ) {
82
- e . preventDefault ( ) ;
83
- e . stopPropagation ( ) ;
84
- openInNewTab ( ) ;
85
- return ;
86
- }
87
- // Regular Enter/Space should open lightbox
80
+ // Only handle Ctrl/Cmd+Enter/Space for opening in new tab
81
+ // Radix UI Dialog.Trigger handles regular Enter/Space automatically
82
+ if ( ( e . key === 'Enter' || e . key === ' ' ) && ( e . ctrlKey || e . metaKey ) ) {
88
83
e . preventDefault ( ) ;
89
- setOpen ( true ) ;
84
+ e . stopPropagation ( ) ;
85
+ openInNewTab ( ) ;
90
86
}
91
87
} ;
92
88
@@ -140,8 +136,6 @@ export function ImageLightbox({
140
136
onKeyDown = { handleKeyDown }
141
137
className = "cursor-pointer border-none bg-transparent p-0 block w-full no-underline"
142
138
aria-label = { `View image: ${ alt } ` }
143
- role = "button"
144
- tabIndex = { 0 }
145
139
>
146
140
{ renderImage ( ) }
147
141
</ div >
You can’t perform that action at this time.
0 commit comments