Skip to content

Commit c5b27e5

Browse files
davemarcoMarco
andauthored
fix(webui): Remove stale DOM node caching which broke keypress-controlled scrolling. (#1083)
Co-authored-by: Marco <[email protected]>
1 parent 5b5fd79 commit c5b27e5

File tree

1 file changed

+3
-7
lines changed
  • components/webui/client/src/components/VirtualTable

1 file changed

+3
-7
lines changed

components/webui/client/src/components/VirtualTable/index.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,15 @@ const VirtualTable = <RecordType extends object = Record<string, unknown>>({
2323
...tableProps
2424
}: VirtualTableProps<RecordType>) => {
2525
const containerRef = useRef<HTMLDivElement>(null);
26-
const scrollNodeRef = useRef<HTMLElement>(null);
2726

2827
const handleKeyDown = useCallback((e: React.KeyboardEvent<HTMLDivElement>) => {
2928
if (null === containerRef.current) {
3029
return;
3130
}
3231

33-
const scrollNode = scrollNodeRef.current;
34-
if (null === scrollNode) {
35-
scrollNodeRef.current = containerRef.current.querySelector<HTMLElement>(
36-
VIRTUAL_TABLE_HOLDER_SELECTOR
37-
);
38-
}
32+
const scrollNode = containerRef.current.querySelector<HTMLElement>(
33+
VIRTUAL_TABLE_HOLDER_SELECTOR
34+
);
3935

4036
if (null === scrollNode) {
4137
return;

0 commit comments

Comments
 (0)