Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

component x-tabuna-breadcrumbs and livewire $refresh #42

Open
monkeydev001 opened this issue Jun 10, 2024 · 0 comments
Open

component x-tabuna-breadcrumbs and livewire $refresh #42

monkeydev001 opened this issue Jun 10, 2024 · 0 comments

Comments

@monkeydev001
Copy link

Hi. I am using a Livewire component

namespace App\Livewire\Admin;
use Livewire\Component;

class Breadcrumbs extends Component
{
    protected $listeners = [
        'refresh-breadcrumbs' => '$refresh',
    ];
    public function render()
    {
        return view('livewire.breadcrumbs');
    }
}

and and <x-tabuna-breadcrumbs> inside view:

    <div class="max-w-12xl mx-auto py-2 px-4 sm:px-6 lg:px-8 d-flex align-items-center">
        <nav style="--bs-breadcrumb-divider: '>';" aria-label="breadcrumb">
            <ol class="breadcrumb mb-0">
                <x-tabuna-breadcrumbs class="breadcrumb-item" active="active"/>
            </ol>
        </nav>
    </div>

When page rendered first time all breadcrumbs shown successfully, but then I dispatch event refresh-breadcrumbs the content of <ol> tags returned empty. It because in refresh moment component detected route livewire.update and couldn't detect a right route of page. Can you help to understand how to fix it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant