diff --git a/js/components/urlBar.js b/js/components/urlBar.js index fb4117229b0..a224810f8ae 100644 --- a/js/components/urlBar.js +++ b/js/components/urlBar.js @@ -45,7 +45,7 @@ class UrlBar extends ImmutableComponent { this.searchSelectEntry = null this.keyPressed = false this.showAutocompleteResult = debounce(() => { - if (!this.urlInput || this.keyPressed) { + if (!this.urlInput || this.keyPressed || this.locationValue.length === 0) { return } const suffixLen = this.props.locationValueSuffix.length @@ -102,6 +102,7 @@ class UrlBar extends ImmutableComponent { windowActions.setUrlBarAutocompleteEnabled(false) } windowActions.setUrlBarSuggestions(undefined, null) + windowActions.setRenderUrlBarSuggestions(false) } onKeyDown (e) { diff --git a/js/stores/windowStore.js b/js/stores/windowStore.js index bbed28fc975..adefeea7f74 100644 --- a/js/stores/windowStore.js +++ b/js/stores/windowStore.js @@ -569,6 +569,10 @@ const doAction = (action) => { case WindowConstants.WINDOW_SET_RENDER_URL_BAR_SUGGESTIONS: windowState = windowState.setIn(activeFrameStatePath().concat(['navbar', 'urlbar', 'suggestions', 'shouldRender']), action.enabled) if (!action.enabled) { + windowState = windowState.mergeIn(activeFrameStatePath().concat(['navbar', 'urlbar', 'suggestions']), { + selectedIndex: null, + suggestionList: null + }) // Make sure to remove the suffix from the url bar windowState = windowState.setIn(activeFrameStatePath().concat(['navbar', 'urlbar', 'suggestions', 'selectedIndex']), null) updateUrlSuffix(undefined)