Repository navigation
v3.35.1
Calendar: refusing a save
The README and the Boost guidelines said a calendar move, resize or select is refused when the host's save method fails validation. In Livewire 4 that is not true: a failed validate() answers normally and $wire.method() resolves with null, so the dropped item stayed where it was dropped although nothing was saved. Throwing or abort() does reject the promise, but Livewire then shows its error modal.
The documented wiring is now:
x-on:calendar-item-move="$event.detail.waitUntil($wire.reschedule($event.detail.id, $event.detail.start, $event.detail.end).then((saved) => saved || Promise.reject()))"with create() and reschedule() returning true once they have saved (and false to refuse). A failed validate() then puts the item back, the errors land in the error bag, and no modal appears. Renderless methods must still return true.
If you wired <atom:calendar> from the v3.35.0 README, add the .then(...) to the select, move and resize handlers and make those methods return true.
Docs and tests only; no code or asset change. (#88)