Skip to content

Commit e194e12

Browse files
authored
Merge pull request #18557 from craftcms/bugfix/18552-slidepicker-and-non-standard-values
ensure SlidePicker value is allowed by min/max/step config
2 parents 2a7bd50 + 17d6656 commit e194e12

4 files changed

Lines changed: 7 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Unreleased
44

55
- Fixed an error that could occur after running the `utils/fix-field-layout-uids` command. ([#18516](https://github.com/craftcms/cms/issues/18516))
6+
- Fixed a JavaScript error that could occur if any field layout elements were configured with unsupported widths. ([#18552](https://github.com/craftcms/cms/issues/18552))
67

78
## 4.17.10 - 2026-03-11
89

src/web/assets/cp/dist/cp.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/web/assets/cp/dist/cp.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/web/assets/cp/src/js/SlidePicker.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,10 @@
141141
setValue: function (value, triggerEvent) {
142142
value = Math.max(Math.min(value, this.max), this.min);
143143

144+
// ensure that the value is valid - matches min, max or any of the steps in between
145+
// if it doesn't match it already, choose the step value that's closest to it
146+
value = Math.round(value / this.settings.step) * this.settings.step;
147+
144148
if (this.value === (this.value = value)) {
145149
return;
146150
}

0 commit comments

Comments
 (0)