Description
After importing data in the Electron AppImage, text inputs stop working app-wide (e.g. Add Item title box can't be focused/typed into). Refreshing fixes it. Does not happen on web (Firefox / GitHub Pages).
Suspected since at least b839074, still present on latest.
Repro
- Open Electron AppImage
- Settings -> Import Data -> pick export JSON -> confirm
Importing will replace all existing data
- Import succeeds
- Go to Add New Item -> click Title input -> no caret, typing does nothing
Expected
Inputs keep working after import.
Actual
All text inputs unfocusable/untypable until window reload (or window blur/focus? untested).
Suspected cause (unverified)
Native window.confirm() in src/app/components/settings/settings.component.ts:582 (onFileSelected) triggers known Electron focus-desync bug (electron/electron#40212, #41603): native alert/confirm steals BrowserWindow focus and renderer never gets keyboard focus back. Same confirm/alert pattern exists in src/app/components/group-manager/group-manager.component.ts:162,167.
Amplifier: settings.component.ts:331-345 nests <button (click)="fileInput.click()"> inside <label> with hidden file input -> double file-picker activation before confirm(). poster-picker.component.ts:91-96 does it correctly (label only).
Data layer looks innocent: after refresh the imported data loads fine (StorageService.importDataWithImages, ImageStorageService.parseExportedImages, ProviderSettingsService.importSettings).
electron/main.ts: frame:false, sandbox:true, no focus restore workaround.
To verify
Suggested fix
- Replace native
confirm/alert with in-app modal (or dialog.showMessageBox via IPC + win.blur(); win.focus() workaround)
- Fix import button: remove
<label> wrapper or explicit .click(), use type="button"
- Apply same to group-manager delete
Description
After importing data in the Electron AppImage, text inputs stop working app-wide (e.g. Add Item title box can't be focused/typed into). Refreshing fixes it. Does not happen on web (Firefox / GitHub Pages).
Suspected since at least
b839074, still present on latest.Repro
Importing will replace all existing dataExpected
Inputs keep working after import.
Actual
All text inputs unfocusable/untypable until window reload (or window blur/focus? untested).
Suspected cause (unverified)
Native
window.confirm()insrc/app/components/settings/settings.component.ts:582(onFileSelected) triggers known Electron focus-desync bug (electron/electron#40212,#41603): native alert/confirm stealsBrowserWindowfocus and renderer never gets keyboard focus back. Sameconfirm/alertpattern exists insrc/app/components/group-manager/group-manager.component.ts:162,167.Amplifier:
settings.component.ts:331-345nests<button (click)="fileInput.click()">inside<label>with hidden file input -> double file-picker activation beforeconfirm().poster-picker.component.ts:91-96does it correctly (label only).Data layer looks innocent: after refresh the imported data loads fine (
StorageService.importDataWithImages,ImageStorageService.parseExportedImages,ProviderSettingsService.importSettings).electron/main.ts:frame:false,sandbox:true, no focus restore workaround.To verify
confirm) cause same symptom? YESconfirm?document.hasFocus()after repro inelectron:devSuggested fix
confirm/alertwith in-app modal (ordialog.showMessageBoxvia IPC +win.blur(); win.focus()workaround)<label>wrapper or explicit.click(), usetype="button"