* Adding tabindex to ImageUpload div wrapper in order to make it selectable * Adding keyboard event handler to listen to Enter key stroke and trigger file upload selection Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
This commit is contained in:
parent
aa7c233177
commit
fb1281dfd2
@ -229,7 +229,11 @@ export const ImageUpload = forwardRef(({ children, className, onSelect, onUpload
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<div className={className} onClick={() => ref.current?.click()} style={{ cursor: 'pointer' }}>
|
<div
|
||||||
|
className={className} onClick={() => ref.current?.click()} style={{ cursor: 'pointer' }} tabindex={0} onKeyDown={(e) => {
|
||||||
|
if (e.key === 'Enter') { ref.current?.click() }
|
||||||
|
}}
|
||||||
|
>
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user