Consider moving focus to <input type=number> when a user clicks on one of its spin buttons
Categories
(Core :: DOM: UI Events & Focus Handling, defect, P3)
Tracking
()
People
(Reporter: mkoch42, Unassigned)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
|
1.29 KB,
patch
|
jwatt
:
review-
|
Details | Diff | Splinter Review |
Updated•11 years ago
|
Comment 1•11 years ago
|
||
Updated•11 years ago
|
Comment 2•11 years ago
|
||
Comment 3•11 years ago
|
||
Comment 4•11 years ago
|
||
Comment 5•11 years ago
|
||
Updated•10 years ago
|
Updated•7 years ago
|
Comment 10•7 years ago
|
||
(In reply to Stephen Horlander [:shorlander] (If you're waiting on a response please ping me on Slack or IRC) from comment #5)
(In reply to Jonathan Watt [:jwatt] from comment #3)
Stephen, do you know anything about the desired UX here, or who would?
We don't seem to be consistent with our form element focus. I think it would
make sense to for us to focus fields with type="number", with the text
cursor placed after the number, if a user changes it with the spinner.
Assuming this is the UX decision, we should implement it.
A related issue: when resetting an unfocsed <input type="date"> element having a default value via clicking the reset button, the focus isn't moved to the input field. At least on Ubuntu 18.04. Chrome does move the focus.
Comment 12•6 years ago
|
||
I think this bug is also related to Bug 1542994
Comment 13•5 years ago
|
||
4.5 years since my previous comment, we're still running into this bug where I work. I managed to work around it by adding onclick="this.focus();" to the input.
Comment 14•5 years ago
|
||
I'm having the same issue,
i.e.
'blur' does not fire on <input type="number"> after (1) clicking on the spinners and (2) moving away
FF 78.0.2 (64-bit)
Chrome and Edge do fire
Updated•5 years ago
|
Comment 15•4 years ago
|
||
Reported 7 years ago and nothing done?
There seems to be some debate about whether clicking the up/down arrows should focus the field.
Another way to think about it is when asking "Which field is in focus?".
If field A is in focus and I click up/down arrows on field B which is a number field, document.activeElement still reports that field A is in focus. This is clearly wrong.
Updated•4 years ago
|
Updated•3 years ago
|
Comment 16•1 year ago
|
||
I just now worked around this in my code:
document.querySelector('#the_number_input').addEventListener('click', function () {
if (document.activeElement !== this) {
this.focus();
}
});
It's a bit annoying to have to do this.
Description
•