mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-05 07:28:01 +00:00
fbbbaa5922
This commit addresses the issue where focusing cells or inputs in the cuesheet table was lost during re-renders. Changes: - Extracted Virtuoso components (Table, TableRow, TableHead, EmptyPlaceholder) into stable, memoized components outside the main CuesheetTable component. - Used Virtuoso's context API to pass dynamic state to the extracted components. - Stabilized the 'meta' object of TanStack Table by using a ref for the data, reducing unnecessary re-renders of cell components. - Modified useReactiveTextInput to skip synchronizing the 'text' state with 'initialText' when the input is focused, preventing user input from being overwritten by external changes. These changes ensure that focus is maintained even when the table re-renders due to concurrent edits or submitting changes, and typed content is preserved. Co-authored-by: cpvalente <34649812+cpvalente@users.noreply.github.com>