fix: #3591872 Fixes how #min and #max step values are calculated.

There is still one edge-case, just not related to our "Step" value configuration. Which is when there is a negative "Maximum" value for the number field, but no "Minimum" is set. By default, Drupal uses a "#min" value of 0 if none is set. But we can't have a minimum of 0 and a maximum of, say -100. It results in a slider field that cannot be moved, and neither can it be saved without failing validation errors.

Ideally we simply do not allow the widget to be used in that particular instance. But this is out of scope for this issue. The "Step" configuration value validation has a safeguard that defaults to 1 if $maximum_step is calculated as equal to or lower than 0.

Closes #3591872

Merge request reports

Loading