diff --git a/src/shared/ui/VirtualList/VirtualList.svelte b/src/shared/ui/VirtualList/VirtualList.svelte index cbc0ea1..719a957 100644 --- a/src/shared/ui/VirtualList/VirtualList.svelte +++ b/src/shared/ui/VirtualList/VirtualList.svelte @@ -52,7 +52,7 @@ interface Props { * * @template T - The type of items in the list */ - children: Snippet<[{ item: T; index: number }]>; + children: Snippet<[{ item: T; index: number; isVisible: boolean; proximity: number }]>; } let { items, itemHeight = 80, overscan = 5, class: className, onVisibleItemsChange, children }: @@ -76,8 +76,13 @@ $effect(() => { class={cn( 'relative overflow-auto rounded-md bg-background', 'h-150 w-full', + 'scroll-smooth', className, )} + onfocusin={(e => { + // Prevent the browser from jumping the scroll when an inner element gets focus + e.preventDefault(); + })} >