Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Selecting cut text from context menu refills URL into URL bar Fixes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
Radoslav Vitanov committed Oct 24, 2016
1 parent 8b00d06 commit a32f948
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion js/components/urlBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -102,6 +102,7 @@ class UrlBar extends ImmutableComponent {
windowActions.setUrlBarAutocompleteEnabled(false)
}
windowActions.setUrlBarSuggestions(undefined, null)
windowActions.setRenderUrlBarSuggestions(false)
}

onKeyDown (e) {
Expand Down
4 changes: 4 additions & 0 deletions js/stores/windowStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a32f948

Please sign in to comment.