From f197463968c123f1df34d36cf8918c7feefba9fc Mon Sep 17 00:00:00 2001 From: dev Date: Sat, 23 May 2026 22:23:18 +0200 Subject: [PATCH] refactor(carousel demo): move Prev/Next triggers outside Viewport MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Canonical placement (matches Mantine, shadcn-svelte): triggers sit as siblings of Viewport (children of the Carousel root), not as siblings of ItemGroup inside Viewport. Keeps the gesture-bearing ItemGroup region clean of unrelated event targets; the recipe's absolute positioning still anchors the triggers correctly because the carousel root is `position: relative`. The "clicks fail" report was the expected disabled state at the last slide under loop=false — verified the next button correctly reports disabled=true + opacity 0.4 once canGoNext becomes false. Enable loop from the controls for infinite navigation. Co-Authored-By: Claude Opus 4.7 (1M context) --- web/routes/uix/components/carousel/+page.svelte | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/web/routes/uix/components/carousel/+page.svelte b/web/routes/uix/components/carousel/+page.svelte index aa1655fdd..1f7ef2bdd 100644 --- a/web/routes/uix/components/carousel/+page.svelte +++ b/web/routes/uix/components/carousel/+page.svelte @@ -142,9 +142,9 @@ ' Slide B', ' Slide C', ' ', - ' ', - ' ', ' ', + ' ', + ' ', ' ', ' {#each slides as _, i}', ' ', @@ -243,9 +243,15 @@ {/each} - - + + + {#each slides as _, i (i)}