From 6e89d24b216980727110e100be554c7be3b2a4cf Mon Sep 17 00:00:00 2001 From: FromTheLOLAshes <153381408+FromTheLOLAshes@users.noreply.github.com> Date: Mon, 24 Jun 2024 12:03:18 -0400 Subject: [PATCH] Fix bug where user can type character into object panel (#525) Co-authored-by: Christopher Oliphant --- app/components/reusable/InputVector/InputVector.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/components/reusable/InputVector/InputVector.tsx b/app/components/reusable/InputVector/InputVector.tsx index 6a3f7836c9..cd8172d6b9 100644 --- a/app/components/reusable/InputVector/InputVector.tsx +++ b/app/components/reusable/InputVector/InputVector.tsx @@ -51,7 +51,7 @@ export const InputVector = ({ if (newValue === "" || newValue === "-" || newValue === ".") { return newValue; } - return /^-?[0-9]*(.[0-9]*)?$/.test(newValue) ? newValue : oldValue; + return /^-?\d*(\.\d{0,2})?$/.test(newValue) ? newValue : oldValue; } function handleOnChange(event: ChangeEvent) {