From 4e05d01651224d0d2103031869fdd133239ea847 Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Thu, 10 Apr 2025 12:31:37 +0530 Subject: [PATCH] prevent expand chevron icon from disappearing --- .../TipTapEditor/components/ExpandableToolbarPreview.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gui/src/components/mainInput/TipTapEditor/components/ExpandableToolbarPreview.tsx b/gui/src/components/mainInput/TipTapEditor/components/ExpandableToolbarPreview.tsx index db923f59b..b7f3d724c 100644 --- a/gui/src/components/mainInput/TipTapEditor/components/ExpandableToolbarPreview.tsx +++ b/gui/src/components/mainInput/TipTapEditor/components/ExpandableToolbarPreview.tsx @@ -134,10 +134,10 @@ export function ExpandableToolbarPreview(props: ExpandableToolbarPreviewProps) { useEffect(() => { const resizeObserver = new ResizeObserver(() => { - setContentDims({ - width: contentRef.current?.scrollWidth ?? 0, - height: contentRef.current?.scrollHeight ?? 0, - }); + setContentDims(prevValue => ({ + width: contentRef.current?.scrollWidth ?? prevValue.width, + height: contentRef.current?.scrollHeight ?? prevValue.height, + })); }); if (contentRef.current) {