mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-11-13 10:26:15 +00:00
This commit works around a couple of bugs, which seem to be upstream bugs in the current version of Electron. First, `webContents.isFocused()` seems to be true even if we just switched to a tab, and are trying to set it as the focused element. To work around this, we check if the `webview` element is the same as `document.activeElement`. Also, as per https://github.com/electron/electron/issues/15718, it looks like `blur` needs to be called on the currently active element, before switching focus on another element i.e., calling `focus` on it. Fixes: #634.