diff --git a/js/components/frame.js b/js/components/frame.js index 140b8b43425..5e72bee231f 100644 --- a/js/components/frame.js +++ b/js/components/frame.js @@ -688,7 +688,10 @@ class Frame extends ImmutableComponent { contextMenus.onShowAutofillMenu(e.suggestions, e.rect, this.frame) }) this.webview.addEventListener('hide-autofill-popup', (e) => { - windowActions.autofillPopupHidden(this.props.tabId) + let webContents = this.webview.getWebContents() + if (webContents && webContents.isFocused()) { + windowActions.autofillPopupHidden(this.props.tabId) + } }) this.webview.addEventListener('ipc-message', (e) => { let method = () => {} diff --git a/js/stores/windowStore.js b/js/stores/windowStore.js index c7aef98806c..b4e199e2364 100644 --- a/js/stores/windowStore.js +++ b/js/stores/windowStore.js @@ -658,8 +658,8 @@ const doAction = (action) => { case windowConstants.WINDOW_AUTOFILL_POPUP_HIDDEN: case windowConstants.WINDOW_SET_CONTEXT_MENU_DETAIL: if (!action.detail) { - if (windowState.getIn('contextMenuDetail', 'type') === 'autofill' && - windowState.getIn('contextMenuDetail', 'tabId') === action.tabId) { + if (windowState.getIn(['contextMenuDetail', 'type']) === 'autofill' && + windowState.getIn(['contextMenuDetail', 'tabId']) === action.tabId) { windowState = windowState.delete('contextMenuDetail') if (action.notify) { ipc.send('autofill-popup-hidden', action.tabId)