fraudTech commited on
Commit
d02c653
·
1 Parent(s): c84c22b

fixed vertical scroll issues in chat window and input area.

Browse files
Files changed (2) hide show
  1. web/src/App.css +1 -0
  2. 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
- // Only auto-scroll if user is near the bottom (within 150px)
274
- const container = messagesContainerRef.current;
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 () => {