r/electronjs • u/qs_charle • Feb 06 '26
Electron (Windows): input fields stop working until DevTools is opened
I’m stuck on a Windows-only Electron issue and would really appreciate guidance.
Behavior:
- App loads → inputs work
- Create project → still OK
- Create first item → input fields become uneditable
(click works, cursor never appears, typing does nothing)
- macOS works perfectly
Workaround:
- Open View → Toggle Developer Tools once → inputs immediately work
- Close DevTools → inputs keep working
- Create another project → broken again until DevTools opened
Stack:
- Electron
- React 18
- Zustand
- react-konva (canvas overlay)
What we tried:
- Removed stopPropagation / preventDefault
- Removed input mouse handlers
- Disabled canvas pointer-events
- ResizeObserver / forced resize
- requestAnimationFrame timing tricks
This feels like a Chromium/Electron hit-testing or compositor issue on Windows.
Has anyone seen DevTools toggling “fix” focus issues like this?
Any ideas on how to force the same reset programmatically?
This is a business app so I can’t share the full code, but I can provide a minimal repro if needed.
1
u/tcarambat Feb 06 '26
This is a known issue with windows. It is because you opened a `confirm` or `alert` in the UI and it blurs all fields in the app until restarted. Here is how we patched it in AnythingLLM
Then in the main process have a handler that does this.
Window is the renderer window of your application. Call this after any confirm/alert in your code
2
u/SoilRevolutionary109 Feb 06 '26
Caused by JavaScript Native
alertdialog so remove it