Problem/Motivation
The new implementation with the range-slider-element behaviour conflicts with step validation for range inputs. Instead of rounding steps relative to the min attribute (the step base), it does so relative to 0.
This causes range sliders to snap to incorrect values when min is not a multiple of step, violating the HTML5 specification and providing unexpected user experience.
Steps to reproduce
Create a slider using these attributes:
$form['slider'] = [
'#type' => 'range_slider',
'#min' => 5,
'#max' => 30,
'#step' => 2,
'#default_value' => 6,
];
Results in:

Proposed resolution
See if the issue can be fixed upstream first https://github.com/andreruffert/range-slider-element/pull/210
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | Screenshot 2025-09-21 at 16.37.39.png | 111.56 KB | baikho |
Issue fork range_slider-3547819
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
baikho commentedComment #3
baikho commentedComment #4
baikho commentedComment #5
baikho commentedComment #6
baikho commentedComment #7
baikho commentedComment #8
baikho commentedComment #11
baikho commented