finally fixed the scrolling issues!

This commit is contained in:
legop3
2025-11-24 04:11:34 -05:00
parent 4a3b91eeab
commit 0e14445685
8 changed files with 29 additions and 23 deletions
+3 -3
View File
@@ -25,7 +25,7 @@ function displayName(message) {
return message.nickname || message.socketId?.slice(0, 6) || 'unknown';
}
export default function ChatPanel({ hideInput = false, hideSpectatorNotice = false }) {
export default function ChatPanel({ hideInput = false, hideSpectatorNotice = false, fillHeight = false }) {
const { session } = useSession();
const { messages, sendMessage, registerInputRef, onInputFocus, onInputBlur, blurChat } = useChat();
const [draft, setDraft] = useState('');
@@ -57,10 +57,10 @@ export default function ChatPanel({ hideInput = false, hideSpectatorNotice = fal
}
}
const listClass = 'h-48';
const listClass = fillHeight ? 'flex-1 min-h-0 overflow-y-auto' : 'h-48 overflow-y-auto';
return (
<section className="panel-section space-y-0.5 text-base">
<section className={`panel-section space-y-0.5 text-base ${fillHeight ? 'flex h-full flex-col overflow-hidden' : ''}`}>
<div className={`surface overflow-y-auto space-y-0.25 ${listClass}`} ref={listRef}>
{sorted.length === 0 ? (
<p className="text-sm text-slate-500">No messages yet.</p>