mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix(a11y): add keyboard support to pdf-to-image upload dropzone
This commit is contained in:
@@ -155,9 +155,17 @@ export function PdfToImageSettings() {
|
|||||||
{/* PDF upload area */}
|
{/* PDF upload area */}
|
||||||
{!file ? (
|
{!file ? (
|
||||||
<div
|
<div
|
||||||
|
role="button"
|
||||||
|
tabIndex={0}
|
||||||
onDragOver={(e) => e.preventDefault()}
|
onDragOver={(e) => e.preventDefault()}
|
||||||
onDrop={handleDrop}
|
onDrop={handleDrop}
|
||||||
onClick={() => fileInputRef.current?.click()}
|
onClick={() => fileInputRef.current?.click()}
|
||||||
|
onKeyDown={(e) => {
|
||||||
|
if (e.key === "Enter" || e.key === " ") {
|
||||||
|
e.preventDefault();
|
||||||
|
fileInputRef.current?.click();
|
||||||
|
}
|
||||||
|
}}
|
||||||
className="border-2 border-dashed border-border rounded-lg p-8 text-center cursor-pointer hover:border-primary/50 transition-colors"
|
className="border-2 border-dashed border-border rounded-lg p-8 text-center cursor-pointer hover:border-primary/50 transition-colors"
|
||||||
>
|
>
|
||||||
<FileUp className="h-8 w-8 mx-auto mb-2 text-muted-foreground" />
|
<FileUp className="h-8 w-8 mx-auto mb-2 text-muted-foreground" />
|
||||||
|
|||||||
Reference in New Issue
Block a user