mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-06 07:20:29 +03:00
fix scroll to alignment
This commit is contained in:
parent
012e894d7a
commit
28448a48c4
1 changed files with 2 additions and 2 deletions
|
|
@ -457,7 +457,7 @@ export function EmojiBoard({
|
|||
|
||||
const handleScrollToGroup = (groupId: string) => {
|
||||
const groupIndex = groups.findIndex((group) => group.id === groupId);
|
||||
virtualizer.scrollToIndex(groupIndex);
|
||||
virtualizer.scrollToIndex(groupIndex, { align: 'start' });
|
||||
};
|
||||
|
||||
// sync active sidebar tab with scroll
|
||||
|
|
@ -484,7 +484,7 @@ export function EmojiBoard({
|
|||
// reset scroll position on tab change
|
||||
useEffect(() => {
|
||||
if (groups.length > 0) {
|
||||
virtualizer.scrollToIndex(0);
|
||||
virtualizer.scrollToIndex(0, { align: 'start' });
|
||||
}
|
||||
}, [tab, virtualizer, groups]);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue