Skip to content

Commit

Permalink
hide-autofill-popup only when webcontent is focused
Browse files Browse the repository at this point in the history
also fix frontend id typo leads to crash

fix brave#5939

Auditor: @bridiver
  • Loading branch information
darkdh committed Dec 1, 2016
1 parent 46cea13 commit adf96f3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion js/components/frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,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 = () => {}
Expand Down
2 changes: 1 addition & 1 deletion js/stores/windowStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ const doAction = (action) => {
windowStore.emitChanges()
return
case WindowConstants.WINDOW_AUTOFILL_SELECTION_CLICKED:
ipc.send('autofill-selection-clicked', action.tabId, action.value, action.frontendId, action.index)
ipc.send('autofill-selection-clicked', action.tabId, action.value, action.frontEndId, action.index)
windowState = windowState.delete('contextMenuDetail')
break
case WindowConstants.WINDOW_AUTOFILL_POPUP_HIDDEN:
Expand Down

0 comments on commit adf96f3

Please sign in to comment.