Spaces:
Sleeping
Sleeping
fixed vertical scroll issues in chat window and input area.
Browse files- web/src/App.css +1 -0
- web/src/App.tsx +2 -8
web/src/App.css
CHANGED
|
@@ -318,6 +318,7 @@ body {
|
|
| 318 |
gap: 1rem;
|
| 319 |
scrollbar-width: thin;
|
| 320 |
scrollbar-color: #3a342e #211d1a;
|
|
|
|
| 321 |
}
|
| 322 |
|
| 323 |
.messages::-webkit-scrollbar {
|
|
|
|
| 318 |
gap: 1rem;
|
| 319 |
scrollbar-width: thin;
|
| 320 |
scrollbar-color: #3a342e #211d1a;
|
| 321 |
+
min-height: 0; /* Critical: allows proper scrolling */
|
| 322 |
}
|
| 323 |
|
| 324 |
.messages::-webkit-scrollbar {
|
web/src/App.tsx
CHANGED
|
@@ -270,14 +270,8 @@ function App() {
|
|
| 270 |
}, [token]);
|
| 271 |
|
| 272 |
useEffect(() => {
|
| 273 |
-
//
|
| 274 |
-
|
| 275 |
-
if (container) {
|
| 276 |
-
const isNearBottom = container.scrollHeight - container.scrollTop - container.clientHeight < 150;
|
| 277 |
-
if (isNearBottom) {
|
| 278 |
-
messagesEndRef.current?.scrollIntoView({ behavior: 'smooth' });
|
| 279 |
-
}
|
| 280 |
-
}
|
| 281 |
}, [messages]);
|
| 282 |
|
| 283 |
const handleSendMessage = async () => {
|
|
|
|
| 270 |
}, [token]);
|
| 271 |
|
| 272 |
useEffect(() => {
|
| 273 |
+
// Always scroll to bottom when messages change
|
| 274 |
+
messagesEndRef.current?.scrollIntoView({ behavior: 'smooth' });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 275 |
}, [messages]);
|
| 276 |
|
| 277 |
const handleSendMessage = async () => {
|