mirror of
https://github.com/Zproger/Aurum.git
synced 2026-10-13 11:06:40 +07:00
fix: скрывать file input бэкапа без display:none
На Firefox (Linux) программный .click() по input[type=file] со стилем display:none может не открывать нативный диалог выбора файла. Теперь инпут скрыт визуально (opacity + нулевой размер), но остаётся в layout.
This commit is contained in:
@@ -80,12 +80,16 @@ export function BackupCard() {
|
|||||||
<Upload size={16} />
|
<Upload size={16} />
|
||||||
{isImporting ? t("backup.importing") : t("backup.importButton")}
|
{isImporting ? t("backup.importing") : t("backup.importButton")}
|
||||||
</Button>
|
</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
|
<input
|
||||||
ref={fileInputRef}
|
ref={fileInputRef}
|
||||||
type="file"
|
type="file"
|
||||||
accept="application/json,.json"
|
accept="application/json,.json"
|
||||||
onChange={handleFileSelected}
|
onChange={handleFileSelected}
|
||||||
className="hidden"
|
className="absolute h-px w-px overflow-hidden opacity-0"
|
||||||
|
tabIndex={-1}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user