Fix bug where user can type character into object panel (#525)

Co-authored-by: Christopher Oliphant <christopheroliphant@christophersmbp.home>
This commit is contained in:
FromTheLOLAshesandChristopher Oliphant authored and GitHub committed 2024-06-24 12:03:18 -04:00
1 parent e8058bb7ac
commit 6e89d24b21
1 file changed
+1 -1
@@ -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<HTMLInputElement>) {