fix: скрывать file input бэкапа без display:none

На Firefox (Linux) программный .click() по input[type=file] со стилем
display:none может не открывать нативный диалог выбора файла. Теперь
инпут скрыт визуально (opacity + нулевой размер), но остаётся в layout.
This commit is contained in:
ZProger
2026-09-10 19:29:39 +03:00
parent cd2e4ae9f9
commit 19ca9c3158

View File

@@ -80,12 +80,16 @@ export function BackupCard() {
<Upload size={16} />
{isImporting ? t("backup.importing") : t("backup.importButton")}
</Button>
{/* Visually hidden via opacity/size, not `display:none` — Firefox on
Linux can silently fail to open the native file dialog when
.click() targets a file input removed from layout entirely. */}
<input
ref={fileInputRef}
type="file"
accept="application/json,.json"
onChange={handleFileSelected}
className="hidden"
className="absolute h-px w-px overflow-hidden opacity-0"
tabIndex={-1}
/>
</div>