Livewire re render can not click modal in table cell #13205
Replies: 1 comment
-
Fixed it by placing a div around it with wire:replace There is no attribute bag on the modal, so adding wire:replace or wire:key to it didnt workk. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Package
Panel builder (resources with forms/tables)
Package Version
Latest
How can we help you?
Hey,
I was wondering if anyone has tried this or experienced this and if i could get some help possibly :)
We have a table with a regular resource and list page.
In this table the cells are made of custom columns with the days of the week, there is a widget above it that i made to paginate the table.
By paginating, i re render the table and update livewire props (url params) to reload the table with new data based on week, so other dates will load in the column and show new results.
The new results are shown properly, however i have a modal in the cell to show grouped data in it based on cell data + date.
What happens is, since debugging it seems everything is still going properly, though when clicking, the modal does not open. Its as if the event is not fired because isOpen is set to true in the modal blade file.
In element inspect removing display none, modal shows up just fine.
On reload it works fine, so its after re rendering / a livewire update that it fails to open.
Snippet of code;
In my widget;
This widget dispatches an event so i can pick it up in my List file (the page overview)
Those props are as follows;
Based on this, params will be set and the resource will reload the table for it.
Which works as follows;
Now what getDays does is simply retrieve week and year from the livewire component (list page) to get the current week and year and then set the days, array will just look as follows;
In the column this is all i do to it,
Set date and in the view the modal should be pre rendered.
with the modal above it and some data thats loaded in it.
The modalId is unique for every modal.
Ive also tried the above but no luck.
I think what happens is on page change it obviously renders somewhat new modals with new data, and because theyre not directly there it may not open even though it should.
Hopefully this is enough information and someone can help me out :)
In action what happens:
(cant click modals, data in cells are modals, but can on reload)
Screen.Recording.2024-06-12.at.10.30.57.mov
Beta Was this translation helpful? Give feedback.
All reactions