From ec7a5fdbd67dc4fcedb5f75d535cd42892e7f503 Mon Sep 17 00:00:00 2001 From: Cristhian Zanforlin Lousa Date: Fri, 8 Sep 2023 10:45:43 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(floatComponent):=20update=20?= =?UTF-8?q?min=20and=20max=20values=20to=20-2=20and=20+2=20respectively=20?= =?UTF-8?q?for=20better=20range=20=F0=9F=94=A7=20chore(floatComponent):=20?= =?UTF-8?q?update=20placeholder=20text=20to=20reflect=20the=20new=20range?= =?UTF-8?q?=20of=20-2=20to=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/frontend/src/components/floatComponent/index.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/frontend/src/components/floatComponent/index.tsx b/src/frontend/src/components/floatComponent/index.tsx index 88e958fc9..46c5b98f2 100644 --- a/src/frontend/src/components/floatComponent/index.tsx +++ b/src/frontend/src/components/floatComponent/index.tsx @@ -10,8 +10,8 @@ export default function FloatComponent({ editNode = false, }: FloatComponentType): JSX.Element { const step = 0.1; - const min = 0; - const max = 1; + const min = -2; + const max = +2; // Clear component state useEffect(() => { @@ -27,10 +27,10 @@ export default function FloatComponent({ step={step} min={min} onInput={(event: React.ChangeEvent) => { - if (event.target.value < min.toString()) { + if (Number(event.target.value) < min) { event.target.value = min.toString(); } - if (event.target.value > max.toString()) { + if (Number(event.target.value) > max) { event.target.value = max.toString(); } }} @@ -39,7 +39,7 @@ export default function FloatComponent({ disabled={disabled} className={editNode ? "input-edit-node" : ""} placeholder={ - editNode ? "Number 0 to 1" : "Type a number from zero to one" + editNode ? "Number -2 to 2" : "Type a number from minus two to two" } onChange={(event) => { onChange(event.target.value);