From d46cbe36504bcd7db860a6052e00499e4b359255 Mon Sep 17 00:00:00 2001 From: Tim Date: Thu, 7 Nov 2024 09:02:37 +0800 Subject: [PATCH] hotfix: * className attribute issue * compatibility issue of the latest version of @tanstack/react-table --- website/src/components/BookmarkableText.tsx | 4 +++- website/src/components/ResizableDataTable.tsx | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/website/src/components/BookmarkableText.tsx b/website/src/components/BookmarkableText.tsx index 40f28953..749c1b85 100644 --- a/website/src/components/BookmarkableText.tsx +++ b/website/src/components/BookmarkableText.tsx @@ -31,6 +31,7 @@ import { useToast } from "@/hooks/use-toast"; interface BookmarkableTextProps { children: React.ReactNode; source: string; + className?: string; } const formSchema = z.object({ @@ -42,6 +43,7 @@ const formSchema = z.object({ const BookmarkableText: React.FC = ({ children, source, + className = "overflow-y-auto" }) => { const [buttonPosition, setButtonPosition] = useState({ x: 0, y: 0 }); const [showButton, setShowButton] = useState(false); @@ -137,7 +139,7 @@ const BookmarkableText: React.FC = ({ ref={textRef} onMouseUp={handleMultiElementSelection} onTouchEnd={handleMultiElementSelection} - className="overflow-y-auto" + className={className} > {children} {showButton && ( diff --git a/website/src/components/ResizableDataTable.tsx b/website/src/components/ResizableDataTable.tsx index 3846208c..a310492e 100644 --- a/website/src/components/ResizableDataTable.tsx +++ b/website/src/components/ResizableDataTable.tsx @@ -219,6 +219,8 @@ function ResizableDataTable({ getPaginationRowModel: getPaginationRowModel(), onColumnSizingChange: (newColumnSizing) => { setColumnSizing(newColumnSizing); + setIsResizing(true); + debouncedSetIsResizing(false); saveSettings(); }, onColumnVisibilityChange: setColumnVisibility, @@ -236,9 +238,7 @@ function ResizableDataTable({ pagination: { pageSize: 5, }, - }, - onColumnSizingStart: () => setIsResizing(true), - onColumnSizingEnd: () => debouncedSetIsResizing(false), + } }); return (