From d4c9c369cf8c612a8e5ff2a98f48eddc4b596853 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Gu=CC=88ell=20Segarra?= Date: Wed, 31 Jul 2024 12:20:15 +0200 Subject: [PATCH] fix: weird bug debugging --- src/components/InfiniteTable/InfiniteTable.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/components/InfiniteTable/InfiniteTable.tsx b/src/components/InfiniteTable/InfiniteTable.tsx index f7c8e7f..c9dbefd 100644 --- a/src/components/InfiniteTable/InfiniteTable.tsx +++ b/src/components/InfiniteTable/InfiniteTable.tsx @@ -16,6 +16,7 @@ import { ColumnMovedEvent, ColumnResizedEvent, ColumnState, + DragStoppedEvent, FirstDataRenderedEvent, GridReadyEvent, IGetRowsParams, @@ -102,8 +103,12 @@ const InfiniteTableComp = forwardRef( ); const onColumnChanged = useCallback( - (e: any) => { - console.log({ e }); + (event: DragStoppedEvent | ColumnResizedEvent) => { + // if (!event.finished) { + // return; + // } + // const et = event.source === "uiColumnResized"; + console.log({ event }); const state = gridRef?.current?.api.getColumnState(); debouncedOnColumnChanged(state); }, @@ -335,7 +340,7 @@ const InfiniteTableComp = forwardRef( suppressRowClickSelection={true} rowBuffer={0} rowSelection={"multiple"} - // onDragStopped={onColumnChanged} + onDragStopped={onColumnChanged} // onColumnMoved={onColumnChanged} onColumnResized={onColumnChanged} rowModelType={"infinite"}