mirror of
https://github.com/Zproger/Aurum.git
synced 2026-10-12 18:46: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} />
|
||||
{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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user