diff --git a/gui/src/components/mainInput/TipTapEditor/components/ExpandableToolbarPreview.tsx b/gui/src/components/mainInput/TipTapEditor/components/ExpandableToolbarPreview.tsx index b7f3d724c..2d3c51b75 100644 --- a/gui/src/components/mainInput/TipTapEditor/components/ExpandableToolbarPreview.tsx +++ b/gui/src/components/mainInput/TipTapEditor/components/ExpandableToolbarPreview.tsx @@ -88,6 +88,7 @@ interface ExpandableToolbarPreviewProps { isSelected?: boolean; /** Content to display in the preview */ children: React.ReactNode; + noContent: boolean; } /** @@ -134,7 +135,7 @@ export function ExpandableToolbarPreview(props: ExpandableToolbarPreviewProps) { useEffect(() => { const resizeObserver = new ResizeObserver(() => { - setContentDims(prevValue => ({ + setContentDims((prevValue) => ({ width: contentRef.current?.scrollWidth ?? prevValue.width, height: contentRef.current?.scrollHeight ?? prevValue.height, })); @@ -156,6 +157,7 @@ export function ExpandableToolbarPreview(props: ExpandableToolbarPreviewProps) { props.isSelected ? vscBadgeBackground : vscCommandCenterInactiveBorder } className="find-widget-skip !my-0" + contentEditable={false} >
- {hidden ? ( - - ) : ( - - )} + {!props.noContent && + (hidden ? ( + + ) : ( + + ))} {props.onDelete && (
- {!hidden && ( + {!hidden && !props.noContent && ( deleteNode()} borderColor={selected ? vscBadgeBackground : undefined} onTitleClick={handleTitleClick} + noContent={!content} > -
+
{item.content}