toggle problem #181
-
Hi, at first, nice component, but i've got problem with toggle, more at captured video. Same problem in your demo. ven-sro.cz.-.Google.Chrome.2021-12-13.09-50-09.mp4thanmks a lot Slavik J. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Maybe it has to do with the Alpine version. Soon we will be uploading the official version to Alpine 3 |
Beta Was this translation helpful? Give feedback.
-
It seems the problem is because turning the toggle on/off refreshes the table but remembers the previous state. Then, by wanting to give it again, it burdens us with the state prior to it. If we select any other element, we see how the one that was causing problems returns to its correct state. I have managed to solve it by doing the following: At the end of the onUpdatedToggleable method (the one that receives the toggle change request), I add the call to the following method: $this->skipRender(); It is a Livewire method that allows you to skip the rendering of the component and, since powergrid is powered by livewire, we can use this method to avoid reloading the component and then confusing it with its state. https://livewire.laravel.com/docs/actions#skipping-re-renders |
Beta Was this translation helpful? Give feedback.
Maybe it has to do with the Alpine version. Soon we will be uploading the official version to Alpine 3