forked from rDrama/rDrama
Scroll to bottom of chat when any drawer closes
parent
a6e9d6d42d
commit
4a24cdfedf
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "chat",
|
"name": "chat",
|
||||||
"version": "0.0.21",
|
"version": "0.0.22",
|
||||||
"main": "./src/index.tsx",
|
"main": "./src/index.tsx",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -59,6 +59,13 @@ function AppInner() {
|
||||||
}
|
}
|
||||||
}, [messages]);
|
}, [messages]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!open) {
|
||||||
|
// Scroll to the bottom after any drawer closes.
|
||||||
|
contentWrapper.current.scrollTop = contentWrapper.current.scrollHeight;
|
||||||
|
}
|
||||||
|
}, [open]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="App" ref={dropRef}>
|
<div className="App" ref={dropRef}>
|
||||||
<div className="App-wrapper">
|
<div className="App-wrapper">
|
||||||
|
|
Loading…
Reference in New Issue