Snap to input type=range tick marks
Categories
(Core :: Layout: Form Controls, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox109 | --- | fixed |
People
(Reporter: evilpies, Assigned: zrhoffman)
References
(Blocks 1 open bug)
Details
Attachments
(3 files)
In Chrome the slider seems to snap to the defined ticks. For example on
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist#range_type it's still quite difficult to hit the tick mark.
Reporter | ||
Updated•3 years ago
|
Assignee | ||
Comment 1•3 years ago
|
||
Responding to Jonathan's magnet effect thoughts in bug 841942
If we have a "magnet effect", how does that interact with @step
and the clamp-to-values that @step introduces, [...] ?
Whichever's magnitude is larger, between the range of the magnet effect (in pixels?) and the @step size should probably be used for value-clamping.
[...] especially when
the @step and @list data points conflict?
Since only values that match the range's step are considered valid, any tick marks that are step mismatches should be skipped (see bug 1803303).
Assignee | ||
Comment 2•3 years ago
|
||
Responding to Jonathan's magnet effect thoughts in bug 841942
If we have a "magnet effect", how does that interact with @step
and the clamp-to-values that @step introduces, [...] ?
Whichever's magnitude is larger, between the range of the tick mark magnet effect (in pixels?) and the @step size could decide whether the tick mark or a step is snapped to.
For example, in the attached testcase, Testcase - snap to tick mark or step, the first range input has a small step size relative to the range input's size, so tick marks get priority for snapping.
In the second range input in that testcase, the steps are large enough that the tick mark "magnet effect" is not observable.
[...] especially when
the @step and @list data points conflict?
Since only values that match the range's step are considered valid, any tick marks that are step mismatches should be skipped (see bug 1803303).
Comment 3•3 years ago
|
||
It's unclear what I'm getting asked here? That seems somewhat reasonable but concrete questions would be better :)
Assignee | ||
Comment 4•3 years ago
|
||
Oops, I meant to ask at the end of my comment Does that all sound okay? Thanks for figuring out what I probably would have been asking :)
Assignee | ||
Comment 5•3 years ago
|
||
Updated•3 years ago
|
Assignee | ||
Comment 7•3 years ago
|
||
Comment 8•3 years ago
|
||
Backed out for causing wpt failures on range-snap-to-tick-marks.
- Backout link
- Push with failures
- Failure Log
- Failure line: TEST-UNEXPECTED-FAIL | /_mozilla/html/rendering/non-replaced-elements/form-controls/range-snap-to-tick-marks-01.html | Snap to a slider's tick marks by clicking near them - assert_equals: expected "-3" but got "15"
Comment 10•3 years ago
|
||
Probably the WPT on android can be fixed by adding a <meta name="viewport" content="width=device-width">
or so.
Assignee | ||
Comment 11•3 years ago
|
||
Thanks, Emilio! Reproduced the android WPT failure, verified that setting the "viewport" <meta>
tag fixes it, and updated D163780 with the fix.
Comment 12•3 years ago
|
||
Comment 13•3 years ago
|
||
bugherder |
Description
•