Skip to content

[Bug] Inputs dead after import in Electron AppImage until refresh #126

Description

@CodeWithMa

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

  1. Open Electron AppImage
  2. Settings -> Import Data -> pick export JSON -> confirm Importing will replace all existing data
  3. Import succeeds
  4. 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

  • Does group delete (confirm) cause same symptom? YES
  • Does file-picker-cancel (no confirm) vs confirm-cancel vs confirm-ok isolate it to confirm?
  • Does alt-tab/minimize-restore fix it without refresh?
  • Check document.hasFocus() after repro in electron:dev

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions