same!
Aug 1, 2023
6
Level 1
wire:navigate and modal issue
Hi,
I have a problem to trigger a modal since the implementation of the navigate.
Livewire component MODAL :
public ?string $view = null;
public array $params = [];
public bool $show = false;
#[On('modal')]
public function modal(string $component, ?array $params = null)
{
$this->view = $component;
$this->params = $params;
$this->show = true;
}
public function render()
{
return view('livewire.modal');
}
Livewire view MODAL :
<x-modal wire:model="show">
@if ($view != null)
@livewire($view, $params, key(time()))
@endif
</x-modal>
I call the component like this :
<x-form.info-button wire:click="$dispatch('modal', { component: 'file-upload' })">
Everything works... except when I change pages and come back to the page with the button present (the click no longer works). The problem appeared from wire:navigate...
Issue : Uncaught (in promise) undefined livewire.js?id=777821c0:273
Some help ? Thank you !
Please or to participate in this conversation.