Add an os check for webview focus events.

This commit is contained in:
Zhongyi Tong
2017-08-02 02:06:45 +08:00
parent 2c8cf2b959
commit 4445baafa9

View File

@@ -100,7 +100,13 @@ class WebView extends BaseComponent {
}
focus() {
this.$el.focus();
// 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.
// See https://github.com/zulip/zulip-electron/issues/216
const osName = SystemUtil.getOS();
if (osName === 'Mac' || osName === 'Linux') {
this.$el.focus();
}
}
hide() {