Commit a7cf8ab1 authored by rbpotter's avatar rbpotter Committed by Commit Bot

Print Preview Componentization: Fix focus issue

Ensure focus remains in the textfield after the user enters a new value,
even if this changes the validity of the input.

Bug: 843952
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: I0fec55a89c10d4b4dcbaff219927ca26fd650594
Reviewed-on: https://chromium-review.googlesource.com/1069254Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#560880}
parent da7dc652
......@@ -92,8 +92,9 @@ const SettingsBehavior = {
// is no way for the user to change the value in this case.
if (!valid)
assert(setting.available, 'Setting is not available: ' + settingName);
if (valid != setting.valid)
this.fire('setting-valid-changed', valid);
const shouldFireEvent = valid != setting.valid;
this.set(`settings.${settingName}.valid`, valid);
if (shouldFireEvent)
this.fire('setting-valid-changed', valid);
}
};
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment