From b1d9bb39881872643a4bb17dd3b9ebeffe1274b2 Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Sun, 8 Nov 2026 11:20:13 +0100 Subject: [PATCH] frontend: NumberTextField gives each input its own id Every NumberTextField had id="frame_time", so the ids repeated on a page and a label could point at another field's input. The id now comes from useId(). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01HVeDQsU5a8AJUdJPgWevAK --- frontend/src/components/NumberTextField.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/NumberTextField.tsx b/frontend/src/components/NumberTextField.tsx index 8535206a4..fae41f79c 100644 --- a/frontend/src/components/NumberTextField.tsx +++ b/frontend/src/components/NumberTextField.tsx @@ -1,4 +1,4 @@ -import {ChangeEvent, memo, ReactNode, useEffect, useState} from 'react'; +import {ChangeEvent, memo, ReactNode, useEffect, useId, useState} from 'react'; import { InputAdornment, SxProps, @@ -38,6 +38,8 @@ function NumberTextField({start_val, default: defaultValue, label, callback, cou const [text, setText] = useState("."); const [err, setErr] = useState(true); const [val, setVal] = useState(0); + // Unique per field, so each label points at its own input + const id = useId(); // Something has to change in parent to trigger setup => otherwise this makes infinite loop. // In case of error state start_val could stay same, but we want to return to "safe" set @@ -79,7 +81,7 @@ function NumberTextField({start_val, default: defaultValue, label, callback, cou callback(new_val, new_err); }; - return