Closed
Bug 1286509
Opened 8 years ago
Closed 8 years ago
Range input does not fire ‘change’ event when the range is changed using the keyboard.
Categories
(Core :: DOM: UI Events & Focus Handling, defect)
Core
DOM: UI Events & Focus Handling
Tracking
()
RESOLVED
FIXED
mozilla51
People
(Reporter: swood, Assigned: stone)
References
Details
Attachments
(3 files, 2 obsolete files)
30 bytes,
text/plain
|
Details | |
6.68 KB,
patch
|
stone
:
review+
|
Details | Diff | Splinter Review |
6.64 KB,
patch
|
ritu
:
approval-mozilla-beta+
|
Details | Diff | Splinter Review |
Range input does not fire ‘change’ event when the range is changed using the keyboard. Keyboard arrow keys cause the slider to visibly shift along, however the ‘change’ event does not fire.
Can be replicated by creating an input of type "range" and listening for the change event with JavaScript. Adjusting the input with the keyboard does not fire the 'change' event.
JS Fiddle Example: https://jsfiddle.net/f1Lgsv7w/
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → sshih
Assignee | ||
Comment 3•8 years ago
|
||
Assignee | ||
Updated•8 years ago
|
Attachment #8776852 -
Flags: feedback?(btseng)
Comment 4•8 years ago
|
||
Comment on attachment 8776852 [details] [diff] [review]
Range input does not fire ‘change’ event when the range is changed using the keyboard.
Review of attachment 8776852 [details] [diff] [review]:
-----------------------------------------------------------------
feedback+ after the following issue is addressed.
::: dom/html/HTMLInputElement.cpp
@@ +3762,5 @@
> frame->InvalidateFrame();
> }
> + }
> + }
> + if (aVisitor.mEvent->mMessage == eKeyUp && aVisitor.mEvent->IsTrusted()) {
nit: please add new line above this line.
::: dom/html/HTMLInputElement.h
@@ +1504,5 @@
> + bool MayFireChangeOnKeyUp(uint32_t aKeyCode) const {
> + return MayFireChangeOnKeyUp(mType, aKeyCode);
> + }
> +
> + static bool MayFireChangeOnKeyUp(uint8_t aType, uint32_t aKeyCode);
This static one looks unnecessary unless we need to handle something similar in HTMLInputElement::HandleTypeChange().
Attachment #8776852 -
Flags: feedback?(btseng) → feedback+
Assignee | ||
Comment 5•8 years ago
|
||
Attachment #8776852 -
Attachment is obsolete: true
Assignee | ||
Updated•8 years ago
|
Attachment #8777764 -
Flags: review?(bugs)
Comment 6•8 years ago
|
||
So change does fire, but only after focus moves elsewhere.
Comment 7•8 years ago
|
||
Comment on attachment 8777764 [details] [diff] [review]
Range input does not fire ‘change’ event when the range is changed using the keyboard.
Nice and simple. thanks.
Could you perhaps still add a test ensuring we get the right order for
keydown/change/keyup
(I think that is wrong, but that is what other browsers have too.
IMO it should be keydown/keyup/change, but risky to change that.)
Attachment #8777764 -
Flags: review?(bugs) → review+
Assignee | ||
Comment 8•8 years ago
|
||
Assignee | ||
Comment 9•8 years ago
|
||
Attachment #8777764 -
Attachment is obsolete: true
Assignee | ||
Comment 10•8 years ago
|
||
Comment on attachment 8778226 [details] [diff] [review]
Range input does not fire ‘change’ event when the range is changed using the keyboard.
Added test to check the event sequence and updated patch summary
Attachment #8778226 -
Flags: review+
Assignee | ||
Updated•8 years ago
|
Keywords: checkin-needed
Comment 11•8 years ago
|
||
Pushed by cbook@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/85105a2f62d2
Range input does not fire ‘change’ event when the range is changed using the keyboard. r=smaug
Keywords: checkin-needed
Comment 12•8 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox51:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
Comment 13•8 years ago
|
||
Approval Request Comment
[Feature/regressing bug #]: regression fix for bug 1291839
[User impact if declined]: using the keyboard to change narration speed in Reader Mode has no effect
[Describe test coverage new/current, TreeHerder]: automated tests and baked on central and aurora
[Risks and why]: n/i for Stone for risk assessment
[String/UUID change made/needed]: none
Flags: needinfo?(sshih)
Attachment #8799519 -
Flags: approval-mozilla-beta?
Assignee | ||
Comment 14•8 years ago
|
||
[Risks and why]: The risk of this patch should be low. But there are some problems of this patch so that we have to uplift it with the patch of 1295719 at the same time.
Flags: needinfo?(sshih)
status-firefox50:
--- → affected
Comment on attachment 8799519 [details] [diff] [review]
Patch for beta50 uplift
Reader mode shipped in Fx49, we should be incrementally improving its quality, Beta50+
Attachment #8799519 -
Flags: approval-mozilla-beta? → approval-mozilla-beta+
Comment 16•8 years ago
|
||
bugherder uplift |
Updated•6 years ago
|
Component: Event Handling → User events and focus handling
You need to log in
before you can comment on or make changes to this bug.
Description
•