Commit 142d4513 authored by dpapad's avatar dpapad Committed by Commit Bot

WebUI: Fix cr-input to work with Polymer 2.

In Polymer 2 the following syntax for registering event listeners
is no longer supported.

listeners: {
  'id.eventName': 'onEventName_',
},

Instead the listener must be added either programmatically, or
declaratively directly on the |id| element.

Bug:875470

Change-Id: I84f1d61b9b669dda1922f6c8d5f2bbc8de211c1c
Reviewed-on: https://chromium-review.googlesource.com/1213380Reviewed-by: default avatarEsmael El-Moslimany <aee@chromium.org>
Commit-Queue: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#589732}
parent 6d5a0e8a
...@@ -18,5 +18,4 @@ SettingsUIBrowserTest.All ...@@ -18,5 +18,4 @@ SettingsUIBrowserTest.All
# TODO(dpapad): The following tests are failing with optimize_webui=true. Fix # TODO(dpapad): The following tests are failing with optimize_webui=true. Fix
# them and move them to the list above. # them and move them to the list above.
-CrElementsInputTest.All
-MaterialBookmarksFocusTest.All -MaterialBookmarksFocusTest.All
...@@ -108,7 +108,9 @@ ...@@ -108,7 +108,9 @@
readonly$="[[readonly]]" maxlength$="[[maxlength]]" readonly$="[[readonly]]" maxlength$="[[maxlength]]"
pattern="[[pattern]]" required="[[required]]" pattern="[[pattern]]" required="[[required]]"
incremental="[[incremental]]" minlength$="[[minlength]]" incremental="[[incremental]]" minlength$="[[minlength]]"
max="[[max]]" min="[[min]]"> max="[[max]]" min="[[min]]" on-focus="onInputFocus_"
on-blur="onInputBlur_" on-change="onInputChange_"
on-keydown="onInputKeydown_">
<div id="underline"></div> <div id="underline"></div>
</div> </div>
<slot name="suffix"></slot> <slot name="suffix"></slot>
......
...@@ -150,10 +150,6 @@ Polymer({ ...@@ -150,10 +150,6 @@ Polymer({
}, },
listeners: { listeners: {
'input.focus': 'onInputFocus_',
'input.blur': 'onInputBlur_',
'input.change': 'onInputChange_',
'input.keydown': 'onInputKeydown_',
'focus': 'focusInput_', 'focus': 'focusInput_',
'pointerdown': 'onPointerDown_', 'pointerdown': 'onPointerDown_',
}, },
...@@ -328,4 +324,4 @@ Polymer({ ...@@ -328,4 +324,4 @@ Polymer({
this.invalid = !this.inputElement.checkValidity(); this.invalid = !this.inputElement.checkValidity();
return !this.invalid; return !this.invalid;
}, },
}); });
\ No newline at end of file
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