fix scroll to alignment

This commit is contained in:
Ajay Bura 2025-09-14 11:27:43 +05:30
parent 012e894d7a
commit 28448a48c4

View file

@ -457,7 +457,7 @@ export function EmojiBoard({
const handleScrollToGroup = (groupId: string) => { const handleScrollToGroup = (groupId: string) => {
const groupIndex = groups.findIndex((group) => group.id === groupId); const groupIndex = groups.findIndex((group) => group.id === groupId);
virtualizer.scrollToIndex(groupIndex); virtualizer.scrollToIndex(groupIndex, { align: 'start' });
}; };
// sync active sidebar tab with scroll // sync active sidebar tab with scroll
@ -484,7 +484,7 @@ export function EmojiBoard({
// reset scroll position on tab change // reset scroll position on tab change
useEffect(() => { useEffect(() => {
if (groups.length > 0) { if (groups.length > 0) {
virtualizer.scrollToIndex(0); virtualizer.scrollToIndex(0, { align: 'start' });
} }
}, [tab, virtualizer, groups]); }, [tab, virtualizer, groups]);