Markup: stable island targets for wishlist, account link and CSRF meta
- x-wishlist-button gets data-wishlist-product on its form root; the server-rendered aria-pressed stays for now. - Both header account links (desktop and mobile menu) share [data-account-link]. - The CSRF meta tag gets id="csrf-token". No visible change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6948c134e3
commit
4fc7880187
3 files changed
+10
-2
No files matched your search
@@ -3,6 +3,10 @@
|
||||
`wishlist` Stimulus controller turns the submit into a fetch and flips
|
||||
aria-pressed, which the CSS (group-aria-pressed) uses to swap the icons.
|
||||
|
||||
[data-wishlist-product] is the island target: the heart state will come
|
||||
from the islands request. aria-pressed is still rendered server-side for
|
||||
now.
|
||||
|
||||
Usage: <x-wishlist-button :product-id="$product['id']" class="absolute top-4 right-4" />
|
||||
--}}
|
||||
@props(['productId'])
|
||||
@@ -16,6 +20,7 @@
|
||||
<form
|
||||
method="POST"
|
||||
action="{{ route('wishlist.toggle', ['productId' => $productId]) }}"
|
||||
data-wishlist-product="{{ $productId }}"
|
||||
data-controller="wishlist"
|
||||
data-action="submit->wishlist#toggle"
|
||||
data-wishlist-add-label-value="{{ $addLabel }}"
|
||||
|
||||
Reference in new issue
Block a user