INPUT element: Changing default value confuses 'change' event detection |
||
Issue description
Version: 56 canary
OS: All
What steps will reproduce the problem?
(1) Load the following HTML
<input value=abc autofocus>
<script>
var i = document.querySelector('input');
i.addEventListener('change', function() { alert('change'); });
i.setAttribute('value', 'def');
</script>
(2) Change 'def' with 'abc', then press TAB key
What is the expected output?
An alert dialog should be shown. It means a 'change' event was dispatched.
What do you see instead?
An alert dialog isn't shown.
Please use labels and text to provide additional information.
,
Oct 26 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/3393d5c2830af28ce61500bf66cdae94cddfc028 commit 3393d5c2830af28ce61500bf66cdae94cddfc028 Author: tkent <tkent@chromium.org> Date: Wed Oct 26 13:28:37 2016 INPUT element: Updating value to the previous defaultValue should dispatch "change" event. We have set defaultValue to m_textAsOfLastFormControlChangeEvent only when input type was determined, and updating defalutValue after it didn't update m_textAsOfLastFormControlChangeEvent. So, 'change' event was not dispatched in some cases. BUG= 659499 Review-Url: https://codereview.chromium.org/2452903002 Cr-Commit-Position: refs/heads/master@{#427675} [add] https://crrev.com/3393d5c2830af28ce61500bf66cdae94cddfc028/third_party/WebKit/LayoutTests/fast/forms/text/text-change-event-after-updating-default.html [modify] https://crrev.com/3393d5c2830af28ce61500bf66cdae94cddfc028/third_party/WebKit/Source/core/html/HTMLInputElement.cpp
,
Oct 26 2016
|
||
►
Sign in to add a comment |
||
Comment 1 by tkent@chromium.org
, Oct 26 2016