From 9089a25199bca552866a8cc1c6f145f0ab7dd703 Mon Sep 17 00:00:00 2001 From: 0HyperCube <78500760+0HyperCube@users.noreply.github.com> Date: Sat, 8 Jan 2022 21:06:15 +0000 Subject: [PATCH] Fix rotation input (#472) --- frontend/src/components/widgets/inputs/NumberInput.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/widgets/inputs/NumberInput.vue b/frontend/src/components/widgets/inputs/NumberInput.vue index 6f8c1ca7..c418aa70 100644 --- a/frontend/src/components/widgets/inputs/NumberInput.vue +++ b/frontend/src/components/widgets/inputs/NumberInput.vue @@ -268,7 +268,11 @@ export default defineComponent({ return; } - const sanitized = clamp(newValue, this.min, this.max); + // We cannot use the clamp function here as we need undifined values to lead to no clamp. + + let sanitized = newValue; + if (typeof this.min === "number") sanitized = Math.max(sanitized, this.min); + if (typeof this.max === "number") sanitized = Math.min(sanitized, this.max); this.setText(sanitized); },