Merge pull request #266 from zulip/window-focus-fix

🎉 Focus webview contents on Window focus #216 #251
This commit is contained in:
Akash Nimare
2017-08-08 18:07:17 +00:00
committed by GitHub

View File

@@ -109,8 +109,11 @@ class WebView extends BaseComponent {
// Explicit focusing the webview causes a bug the input cannot regain focus on Winodws. // Explicit focusing the webview causes a bug the input cannot regain focus on Winodws.
// The bug is introduced from Electron and this is a tempory fix. // The bug is introduced from Electron and this is a tempory fix.
// See https://github.com/zulip/zulip-electron/issues/216 // See https://github.com/zulip/zulip-electron/issues/216
// temporary fix const webContents = this.$el.getWebContents();
this.$el.focus(); if (webContents && !webContents.isFocused()) {
this.$el.focus();
webContents.focus();
}
} }
hide() { hide() {