This repository has been archived by the owner on Dec 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 974
URL bar autocomplete mouseover does not interfere with typed URL (fixes #3012) #3128
Closed
Closed
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ac31b2e
Mousing over URL bar autocomplete suggestions in dropdown suggests bu…
9f3e423
Keep urlBar#onBlur from interfering with autocomplete suggestion handler
c3677e3
Fix bad case in CSS selector
0de4146
Keep urlBar#onBlur from interfering with autocomplete suggestion handler
6b2139c
merge
1a791f4
Adding test for #3012 fix
fb32aa0
merge
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,9 @@ var searchProviders = require('../data/searchProviders') | |
const searchIconSize = 16 | ||
const UrlUtil = require('../lib/urlutil') | ||
|
||
const EventUtil = require('../lib/eventUtil') | ||
const eventElHasAncestorWithClasses = EventUtil.eventElHasAncestorWithClasses | ||
|
||
const { isUrl, isIntermediateAboutPage } = require('../lib/appUrlUtil') | ||
|
||
class UrlBar extends ImmutableComponent { | ||
|
@@ -203,8 +206,11 @@ class UrlBar extends ImmutableComponent { | |
windowActions.setUrlBarSelected(false) | ||
// On blur, a user expects the text shown from the last autocomplete suffix | ||
// to be auto entered as the new location. | ||
this.updateLocationToSuggestion() | ||
this.clearSearchEngine() | ||
|
||
if (!eventElHasAncestorWithClasses(e, ['urlBarSuggestions', 'urlbarForm'])) { | ||
this.updateLocationToSuggestion() | ||
} | ||
} | ||
|
||
updateLocationToSuggestion () { | ||
|
@@ -250,9 +256,13 @@ class UrlBar extends ImmutableComponent { | |
} | ||
|
||
onActiveFrameStop () { | ||
this.restore() | ||
windowActions.setUrlBarSelected(true) | ||
windowActions.setUrlBarActive(false) | ||
if (this.isFocused()) { | ||
windowActions.setUrlBarActive(false) | ||
if (!this.shouldRenderUrlBarSuggestions) { | ||
this.restore() | ||
windowActions.setUrlBarSelected(true) | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think there's some kind of a rebase issue here, please rebase from current master |
||
} | ||
} | ||
|
||
componentWillMount () { | ||
|
@@ -300,14 +310,6 @@ class UrlBar extends ImmutableComponent { | |
} | ||
|
||
get locationValue () { | ||
// If there's a selected autocomplete entry, we just want to show its location | ||
if (this.props.suggestionIndex) { | ||
const suggestionLocation = this.props.urlbar.getIn(['suggestions', 'suggestionList', this.props.suggestionIndex - 1]).location | ||
if (suggestionLocation) { | ||
return suggestionLocation | ||
} | ||
} | ||
|
||
let location = this.props.urlbar.get('location') | ||
const history = this.props.history | ||
if (isIntermediateAboutPage(location) && history.size > 0) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this change doesn't seem necessary, any reason for it?