Problem: When electron-reload detects changes, it correctly refreshes the webcontents of a BrowserWindow but it annoyingly switches focus from VSCode to the Electron app instance. This means I can no longer type in VSCode until I shift focus back.
I've been using electron-reload with VSCode for a long time and never experienced this behavior – the focus always stayed with the VSCode window I was working in. Recently I upgraded to the latest versions of Electron and electron-reload along with upgrading my OSX version to "Big Sur" and began seeing this behavior.
Has anyone else encountered this and is there a fix? I've tried initialing electron-reload with both methods below with the same result.
require('electron-reload')(__dirname, {
electron: upath.join(__dirname, 'node_modules', '.bin', 'electron')
});
require('electron-reload')(__dirname);