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({
7777 } ;
7878
7979 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 ) ) {
8883 e . preventDefault ( ) ;
89- setOpen ( true ) ;
84+ e . stopPropagation ( ) ;
85+ openInNewTab ( ) ;
9086 }
9187 } ;
9288
@@ -140,8 +136,6 @@ export function ImageLightbox({
140136 onKeyDown = { handleKeyDown }
141137 className = "cursor-pointer border-none bg-transparent p-0 block w-full no-underline"
142138 aria-label = { `View image: ${ alt } ` }
143- role = "button"
144- tabIndex = { 0 }
145139 >
146140 { renderImage ( ) }
147141 </ div >
You can’t perform that action at this time.
0 commit comments