-
Notifications
You must be signed in to change notification settings - Fork 33
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
addSelectedRows body props do not update with selected state #164
Comments
Actually, this is very odd, I figured out what's happening. If the incoming table data is updated via a call to I suspect this is due to the row prop association to the row not being recalculated when the id assigned to each row changes. The row props are stored by index (I think), so if e.g. a row had id 1 and index 3, and then the data updates such that the row with id 1 is at index 1, checking that row now marks the row at index 3 as checked in row props. |
Adding to this. The issue only pops up when |
@shawnphoffman are you sure? in my case, I am not using subrows, yet I still experience this desynchronization from the table input data when the input data is updated with some rows removed and other rows added compared to the currently selected row set. |
@fnimick @shawnphoffman I think I experienced this issue also when i was using Use |
This sounds very similar to an issue I'm experiencing which I put together on the discussions board. I'm not using |
Found a solution:
Don't ask why))) |
This sparked me to dig into it again and I finally figured out a solution for my issues. My issue stemmed from the combination of My table is basically a file/folder tree and it was misbehaving by pre-selecting entire folder structures that didn't have any files in them. Digging through the documentation I noticed that when I haven't dug into the library code yet but it looks like there is a truthy bug when it comes to checking whether or not an item has children and that subsequently trickled up and caused issues with the "is the row selected" logic. Anyway, I hope this helps someone... The Fix Before:
After:
Weird... |
@shawnphoffman Thank you for the extensive and detailed report. You're right in that it's probably a truthiness bug, and I would greatly appreciate if you could file a fix for this issue in the plugin! |
Fixes bryanmylee#164 Issue occurs when children string property is an empty array
Not entirely sure why, this is working in the REPL demo, yet doesn't work in my application. There are no errors logged to the console.
And my SelectIndicator is:
The row's props for the selected state is only true for row 0, and false for all other rows. This does not update along with selections.
The text was updated successfully, but these errors were encountered: