From 91fa08074bd1176aade035d441015b92fddb78d7 Mon Sep 17 00:00:00 2001 From: Ilia Mashkov Date: Sat, 31 Jan 2026 11:53:18 +0300 Subject: [PATCH] feat(VirtualList): incorporate shadcn scroll area to replace default scoll bar --- src/shared/ui/VirtualList/VirtualList.svelte | 63 ++++++++++---------- 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/src/shared/ui/VirtualList/VirtualList.svelte b/src/shared/ui/VirtualList/VirtualList.svelte index 474f450..3c6bf35 100644 --- a/src/shared/ui/VirtualList/VirtualList.svelte +++ b/src/shared/ui/VirtualList/VirtualList.svelte @@ -6,9 +6,11 @@ - Keyboard navigation (ArrowUp/Down, Home, End) - Fixed or dynamic item heights - ARIA listbox/option pattern with single tab stop + - Custom shadcn ScrollArea scrollbar --> -
{ - // Prevent the browser from jumping the scroll when an inner element gets focus - e.preventDefault(); - })} + -
-
- - {#each virtualizer.items as item (item.key)} -
- {#if item.index < items.length} - {@render children({ +
+ {#each virtualizer.items as item (item.key)} +
+ {#if item.index < items.length} + {@render children({ item: items[item.index], index: item.index, isVisible: item.isVisible, proximity: item.proximity, })} - {/if} -
- {/each} -
+ {/if} +
+ {/each} +
+