From 02a729d67befa6712dc9e8715d57fef7924d5449 Mon Sep 17 00:00:00 2001 From: Marco Antonio Ghiani Date: Mon, 19 Feb 2024 11:19:57 +0100 Subject: [PATCH 1/2] fix(euiDataGrid): clean up timeout when component unmounts --- src/components/datagrid/utils/grid_height_width.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/datagrid/utils/grid_height_width.ts b/src/components/datagrid/utils/grid_height_width.ts index f7239ac7014..e1479cdb76d 100644 --- a/src/components/datagrid/utils/grid_height_width.ts +++ b/src/components/datagrid/utils/grid_height_width.ts @@ -183,12 +183,14 @@ export const useVirtualizeContainerWidth = ( useEffect(() => { // wait for layout to settle, then measure virtualize container - setTimeout(() => { + const timerId = setTimeout(() => { if (virtualizeContainer?.clientWidth) { const containerWidth = virtualizeContainer.clientWidth; setVirtualizeContainerWidth(containerWidth); } }, 100); + + return () => clearTimeout(timerId); }, [pageSize, virtualizeContainer]); // Use clientWidth of the virtualization container to take scroll bar into account From 9de824892d166a8b3d1119df77565ec207c2f7d9 Mon Sep 17 00:00:00 2001 From: Marco Antonio Ghiani Date: Mon, 19 Feb 2024 11:26:53 +0100 Subject: [PATCH 2/2] docs(euiTextTruncatee): add changelog entry --- changelogs/upcoming/7534.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 changelogs/upcoming/7534.md diff --git a/changelogs/upcoming/7534.md b/changelogs/upcoming/7534.md new file mode 100644 index 00000000000..e68482dfd65 --- /dev/null +++ b/changelogs/upcoming/7534.md @@ -0,0 +1,3 @@ +**Bug fixes** + +- Fixed `EuiDataGrid` component to clean up timer from side effect on unmount \ No newline at end of file