Bring a pressed carousel item into focus, though it is a tab stop

Plan step 32, found by the Browser suite. Since containment.md C-18 put
the tab stop on each item, the item itself matches the selector for
interactive controls, so every press on an item read as a press on a
control inside it and never scrolled a partly hidden item into focus. A
mouse press still worked through the focus it gives the item; an activation
that clicks without focusing, as a test or assistive technology does, did
nothing. Only a control other than the item counts now.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qwx5USif3wFFmxtHg5U1g9
This commit is contained in:
Andreas Reinhold / reini
2026-09-14 13:36:12 +02:00
co-authored by Claude Opus 5
parent 3434426e23
commit 0d6b0035ed
+2 -1
View File
@@ -1198,9 +1198,10 @@ document.addEventListener('alpine:init', () => {
const element = event.target.closest(ITEM) const element = event.target.closest(ITEM)
const index = state.items.findIndex((item) => item.element === element) const index = state.items.findIndex((item) => item.element === element)
// The item is a tab stop itself, so it matches INTERACTIVE: only a control inside it counts.
const control = event.target.closest(INTERACTIVE) const control = event.target.closest(INTERACTIVE)
if (index >= 0 && this.isMasked(index) && !(control && element.contains(control))) { if (index >= 0 && this.isMasked(index) && !(control && control !== element && element.contains(control))) {
this.scrollToItem(index) this.scrollToItem(index)
} }
}, },