-
-
Notifications
You must be signed in to change notification settings - Fork 328
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
[Bug]: Sorting breaks table when using LivewireComponentColumn #1950
Comments
Small but important update, also linking to this other issue: #1644 the issue seems to be resolved by providing a unique key in the attributes of the LivewireComponentColumn. Looking at the source code i thought that the key was already being passed by the main class, instead it needs to be passed through the attributes:
|
@maikezan - so by default, it should receive a wire key of
However - your approach is absolutely fine. Can I ask what you're using a Livewire Component Column for? It's certainly an edge case! |
Hi @lrljoe ! About why we chose the livewire column: |
That seems like a legitimate and typical use case for a Livewire Component Column, so no moans from me! Now, you COULD do that listening via AlpineJS., keeping things client-side, and smoother, which at scale would be better, but if you're dealing with a production instance, which has <5,000 concurent users on the site, then this really won't make too much of a difference I will definitely take a look at the Livewire Component Column to look at what's going awry, as it should absolutely "just work". Sharing a "working" and "non-working" example helps immensely here. (feel free to ping me on the official Discord should you wish). |
What happened?
Clicking a field column header with sorting enabled, should apply the requested sort with no errors. Instead the sort is applied but then the datatable breaks.
Filtering and columns visibility seems to work fine.
How to reproduce the bug
Build a datatable, use a LivewireComponentColumn as one of the columns.
Click on any orderable field. Data is sorted but the table breaks.
This is more evident if you enable bulk actions. because some checkboxes disappears like the screenshots below
In browser console there is the following js, livewire related error:
Uncaught Component already initialized
Package Version
3.4.16
PHP Version
8.3.x
Laravel Version
11.21.0
Alpine Version
3.14.1
Theme
Tailwind 3.x
Notes
No response
Error Message
Uncaught Component already initialized
The text was updated successfully, but these errors were encountered: