File tree Expand file tree Collapse file tree
frontend/src/components/widgets/inputs Expand file tree Collapse file tree Original file line number Diff line number Diff line change 127127
128128 // The simple `clamp()` function can't be used here since `undefined` values need to be boundless
129129 let sanitized = value ;
130+ if (mode == " Increment" ) {
131+ if (typeof min === " number" ) sanitized = Math .max (sanitized , min );
132+ if (typeof max === " number" ) sanitized = Math .min (sanitized , max );
133+ }
130134 text = displayText (sanitized , unit );
131135 }
132136
138142 let newValueValidated = newValue !== undefined ? newValue : oldValue ;
139143
140144 if (newValueValidated !== undefined ) {
145+ if (mode == " Increment" ) {
146+ if (typeof min === " number" && ! Number .isNaN (min )) newValueValidated = Math .max (newValueValidated , min );
147+ if (typeof max === " number" && ! Number .isNaN (max )) newValueValidated = Math .min (newValueValidated , max );
148+ }
149+
141150 if (isInteger ) newValueValidated = Math .round (newValueValidated );
142151
143152 rangeSliderValue = newValueValidated ;
You can’t perform that action at this time.
0 commit comments