Open chringel21 opened 1 month ago
Hello!
Thanks for being so clear in the description of the issue, because I already know what could be causing the bug.
I'll take a look it and try to fix it this weekend.
@chringel21 I got it fixed but only if you catch the userEvent
emitted from the status component and then update the status
of the original data.
How it is working now: mark entry X with 1 and entry Y with status 2. If filter only shows entry Y, then entry Y will correctly have status 2, but after filter is cleared, the status of Y remains and the status of X becomes empty. That is because we render each row in a for loop, and after the filter is applied, the component with the status is destroyed, along with its internal state. The only way to keep the internal state is to update the original data.
I forgot to update the code. I updated it and released a minor version, v2.1.2.
This bug has been partially fixed.
The problem is: only some components are rendered and when you filter them out, they are destroyed by Vue along with their state. I was not able to use KeepAlive to preserve their state. If I render all rows using Vue, then we will have performance issues.
I think the best way to handle it is for you to mutate the original array after the component is updated. I'll share a demo on how to do that soon.
Hi @uwla ,
sorry to bring this up again, but this issue is very similar to #91 .
If a custom cell component contains a select input based on data and the selected option is changed, the change is not reflected when applying a search filter, even though the underlying data is updated correctly using the
userEvent
event.I created a CodeSandbox where you can see the issue:
Current output The updated status remains in the third row. The select input is not updated correctly.
Expected output The select input is updated correctly when a search filter is applied.
https://github.com/user-attachments/assets/669b5ac9-cfa7-4067-a60c-eafcce1a807b
Thanks again for your help!