Breadcrumb trail removed after calling livewire method via blade
Expected Behavior
When I implement the breadcrumbs into a livewire full page component according to the documentation, it should keep its trail upon component update.
Actual Behavior
After a full page component update, the breadcrumb trail is removed except for home.
Steps to Reproduce the Problem
- Full Page Component: https://github.com/marcoluzi/lingua-vault/blob/a9144d78512de299bdb6e561f063f3c5216c629a/app/Livewire/Pages/Lessons.php
- Full Page View: https://github.com/marcoluzi/lingua-vault/blob/a9144d78512de299bdb6e561f063f3c5216c629a/resources/views/livewire/pages/lessons.blade.php
- Page Header Component: https://github.com/marcoluzi/lingua-vault/blob/a9144d78512de299bdb6e561f063f3c5216c629a/app/Livewire/Components/PageHeader.php
- Page Header View: https://github.com/marcoluzi/lingua-vault/blob/a9144d78512de299bdb6e561f063f3c5216c629a/resources/views/livewire/components/page-header.blade.php
After the page is loaded, change the sorting order using the dropdown. After the new order is applied, all items except for the home item get removed from the breadcrumbs.
Specifications
App runs inside laravel sail container.
I did some more debugging. It's not tied to general full page component update but rather to calling livewire component methods via blade. For example, the sorting dropdown uses @click='open = false; $wire.sortBy("title")' on the individual dropdown items. It breaks on click. I have another full page component that utilizes the same method using @click="open = false; $wire.setLanguage('fr')". Those are the only two instances where the trail gets removed.
I also tried the following things without success:
- Replacing
@clickwithx-on:click - Removing
open = false; - Adding trailing
;to$wire.sortBy("title")/$wire.setLanguage('fr')