Skip to content

Commit a9a6786

Browse files
committed
Fix #[range] to act as a soft min/max
This is a follow up to #2464
1 parent fbefa5b commit a9a6786

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

frontend/src/components/widgets/inputs/NumberInput.svelte

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,6 @@
127127
128128
// The simple `clamp()` function can't be used here since `undefined` values need to be boundless
129129
let sanitized = value;
130-
if (typeof min === "number") sanitized = Math.max(sanitized, min);
131-
if (typeof max === "number") sanitized = Math.min(sanitized, max);
132-
133130
text = displayText(sanitized, unit);
134131
}
135132
@@ -141,9 +138,6 @@
141138
let newValueValidated = newValue !== undefined ? newValue : oldValue;
142139
143140
if (newValueValidated !== undefined) {
144-
if (typeof min === "number" && !Number.isNaN(min)) newValueValidated = Math.max(newValueValidated, min);
145-
if (typeof max === "number" && !Number.isNaN(max)) newValueValidated = Math.min(newValueValidated, max);
146-
147141
if (isInteger) newValueValidated = Math.round(newValueValidated);
148142
149143
rangeSliderValue = newValueValidated;

0 commit comments

Comments
 (0)