-
-
! el.hasAttribute(‘disabilitato’))
},
firstFocusable() { return this.focusables()[0] },
lastFocusable() { return this.focusables().slice(-1)[0] },
nextFocusable() { return this.focusables()[this.nextFocusableIndex()] || this.firstFocusable() },
prevFocusable() { return this.focusables()[this.prevFocusableIndex()] || this.lastFocusable() },
nextFocusableIndex() { return (this.focusables().indexOf(document.activeElement) + 1) % (this.focusables().length + 1) },
prevFocusableIndex() { return Math.max(0, this.focusables().indexOf(document.activeElement)) -1 },
}”
x-init=”$watch(‘mostra’, valore => {
se (valore) {
document.body.classList.add(‘overflow-y-hidden’);
Vicino
},
firstFocusable() { return this.focusables()[0] },
lastFocusable() { return this.focusables().slice(-1)[0] },
nextFocusable() { return this.focusables()[this.nextFocusableIndex()] || this.firstFocusable() },
prevFocusable() { return this.focusables()[this.prevFocusableIndex()] || this.lastFocusable() },
nextFocusableIndex() { return (this.focusables().indexOf(document.activeElement) + 1) % (this.focusables().length + 1) },
prevFocusableIndex() { return Math.max(0, this.focusables().indexOf(document.activeElement)) -1 },
}”
x-init=”$watch(‘mostra’, valore => {
se (valore) {
document.body.classList.add(‘overflow-y-hidden’);
} altro {
document.body.classList.remove(‘overflow-y-hidden’);
}
})”
x-on:open-modal.window=”if ($event.detail == ‘photos_0’) { show = true }”
x-on:close.stop=”mostra = false”
x-on:keydown.escape.window=”mostra = false”
x-on:keydown.tab.prevent=”$event.shiftKey || successivoFocusable().focus()”
x-on:keydown.shift.tab.prevent=”prevFocusable().focus()”
x-mostra=”mostra”
class=”fixed inset-0 overflow-y-auto px-4 py-6 z-50 flex items-center”
style=”display: nessuno;”
>
Vicino