fix(a11y): restore native keyboard file selection
This commit is contained in:
@@ -144,6 +144,7 @@ export default function AddJobModal({ open, onClose, onCreated, initialUrl }: Pr
|
||||
const [notes, setNotes] = useState("");
|
||||
const [generateTailoredCv, setGenerateTailoredCv] = useState(false);
|
||||
const [attachments, setAttachments] = useState<AttachmentBuckets>(() => emptyAttachmentBuckets());
|
||||
const attachmentInputRef = useRef<HTMLInputElement>(null);
|
||||
|
||||
useEffect(() => {
|
||||
setCompanies(cachedCompanies);
|
||||
@@ -421,10 +422,10 @@ export default function AddJobModal({ open, onClose, onCreated, initialUrl }: Pr
|
||||
<Typography sx={{ fontWeight: 800 }}>{label}</Typography>
|
||||
<Typography variant="body2" sx={{ color: "text.secondary" }}>{helperText}</Typography>
|
||||
</Box>
|
||||
<Button component="label" variant="outlined" size="small" startIcon={<UploadFileOutlinedIcon />}>
|
||||
<Button variant="outlined" size="small" startIcon={<UploadFileOutlinedIcon />} onClick={() => attachmentInputRef.current?.click()}>
|
||||
{t("addJobModalChooseFiles")}
|
||||
<input hidden type="file" multiple accept={ACCEPTED_DOCUMENT_TYPES} onChange={(e) => setFilesForBucket(bucket, e.target.files)} />
|
||||
</Button>
|
||||
<input ref={attachmentInputRef} hidden type="file" multiple accept={ACCEPTED_DOCUMENT_TYPES} onChange={(e) => setFilesForBucket(bucket, e.target.files)} />
|
||||
</Box>
|
||||
<Typography variant="caption" sx={{ display: "block", mt: 1, color: "text.secondary" }}>
|
||||
{filesLabel(attachments[bucket])}
|
||||
|
||||
Reference in New Issue
Block a user