From 0c458c671eaa28917e2e27733798df626f874f1f Mon Sep 17 00:00:00 2001 From: "tkent@chromium.org" Date: Wed, 31 Jul 2013 04:17:10 +0000 Subject: [PATCH] Settings: Home page URL is not shown if closing home page overlay by 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 --- chrome/browser/resources/options/options_page.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/chrome/browser/resources/options/options_page.js b/chrome/browser/resources/options/options_page.js index a3a30ab829c9..5d3fa6782685 100644 --- a/chrome/browser/resources/options/options_page.js +++ b/chrome/browser/resources/options/options_page.js @@ -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. -- 2.11.4.GIT