diff --git a/chat/package.json b/chat/package.json index 4df129f8c..8a5b4e211 100644 --- a/chat/package.json +++ b/chat/package.json @@ -1,6 +1,6 @@ { "name": "chat", - "version": "0.0.21", + "version": "0.0.22", "main": "./src/index.tsx", "license": "MIT", "dependencies": { diff --git a/chat/src/App.tsx b/chat/src/App.tsx index 6eb01dfad..d4d774754 100644 --- a/chat/src/App.tsx +++ b/chat/src/App.tsx @@ -58,6 +58,13 @@ function AppInner() { contentWrapper.current.scrollTop = contentWrapper.current.scrollHeight; } }, [messages]); + + useEffect(() => { + if (!open) { + // Scroll to the bottom after any drawer closes. + contentWrapper.current.scrollTop = contentWrapper.current.scrollHeight; + } + }, [open]); return (