diff --git a/src/frontend/src/components/core/playgroundComponent/chat-view/chat-input/components/no-input.tsx b/src/frontend/src/components/core/playgroundComponent/chat-view/chat-input/components/no-input.tsx index f56f41e2ec9f..a54ea947ca0d 100644 --- a/src/frontend/src/components/core/playgroundComponent/chat-view/chat-input/components/no-input.tsx +++ b/src/frontend/src/components/core/playgroundComponent/chat-view/chat-input/components/no-input.tsx @@ -37,7 +37,7 @@ const NoInputView = ({ )} -

+

Add a{" "} (0); + + useEffect(() => { + chatValueRef.current = chatValue; + }, [chatValue]); + + useEffect(() => { + const textarea = inputRef.current; + if (!textarea) return; + + const resizeObserver = new ResizeObserver((entries) => { + for (const entry of entries) { + if (entry.contentRect.width !== previousWidthRef.current) { + previousWidthRef.current = entry.contentRect.width; + resizeTextarea( + textarea, + chatValueRef.current, + previousScrollHeightRef, + ); + } + } + }); + + resizeObserver.observe(textarea); + + return () => { + resizeObserver.disconnect(); + }; + }, [inputRef]); + const handleChange = useCallback( (event: React.ChangeEvent) => { const newValue = event.target.value; diff --git a/src/frontend/src/components/core/playgroundComponent/sliding-container/components/flow-page-sliding-container.tsx b/src/frontend/src/components/core/playgroundComponent/sliding-container/components/flow-page-sliding-container.tsx index bd3e4c34c66b..8c2aa38831b3 100644 --- a/src/frontend/src/components/core/playgroundComponent/sliding-container/components/flow-page-sliding-container.tsx +++ b/src/frontend/src/components/core/playgroundComponent/sliding-container/components/flow-page-sliding-container.tsx @@ -191,7 +191,7 @@ export function FlowPageSlidingContainerContent({ resize="smooth" initial="instant" > - +

( ({ className, password, editNode, ...props }, ref) => { return ( -
+