Skip to content

Commit

Permalink
Settings: Home page URL is not shown if closing home page overlay by …
Browse files Browse the repository at this point in the history
…Enter key

This fixes a problem similar to crbug.com/258345.

HomePageOverlay assumes a 'change' event is dispatched when it is
closed, before committing preference values in
SettingsDialog.handleConfirm(). 'blur' event for a URL field, which
triggers a 'change' event, is not dispatched if:
  * there is no focused element when opening the overlay, and
  * we close the overlay by Enter key
because OptionsPage.setOverlayVisible_() hides itself asynchronously and
the last focus is not restored.
We should make sure setOverlayVisible_(false) removes focus immediately.

BUG=263734

Review URL: https://chromiumcodereview.appspot.com/20141006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@214558 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
tkent@chromium.org committed Jul 31, 2013
1 parent 3bf2ac1 commit 0c458c6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions chrome/browser/resources/options/options_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,9 @@ cr.define('options', function() {
container.classList.remove('transparent');
this.onVisibilityChanged_();
} else {
// Kick change events for text fields.
if (pageDiv.contains(document.activeElement))
document.activeElement.blur();
var self = this;
// TODO: Use an event delegate to avoid having to subscribe and
// unsubscribe for webkitTransitionEnd events.
Expand Down

0 comments on commit 0c458c6

Please sign in to comment.