-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
[TableRow] does NOT remain select when showing Drawer on TableRow select #4738
Comments
I am also facing same issue. If you don't do any state update in callback function, it stays selected. But if we change state, then selection is unchecked. |
Facing the same issue, as described above. |
I'm seeing something similar. If I have any onRowSelection callback defined and I do anything like modifying state in the callback then the row is not selected, but the callback is fired. The row is selected if I click on it again. |
This is also true if you dispatch an action through Redux and modify some completely unrelated state which shouldn't be of any interest to the table (because, frankly, I didn't write the code yet which uses that state). Also: This worked in 0.15.1 |
Okay: Follow-up: ANY kind of state change will reset the table. Even when said state change is done by completely unrelated components and does not change the UI at all This makes the Table completely unusable. |
Also: The SelectAll is not affected by this. If I hit SelectAll and then change the state, all rows will stay selected. |
Okay, figured it out, at least for me: You must isolate the table completely and utterly into its own component. Then you only pass static props into this component. Because as soon as one of those props changes, even if it isn't anywhere near related to anything the table uses and even if the prop doesn't actually change anything in the UI, your table will reset. |
Ah I have the same issue. As soon as I try to do something in the onRowSelected callback the row gets unselected. If I do nothing in the callback it all works fine. |
Again: Isolate the table thus that the table state is not changed through the selection. I.e. you need to use something like Redux to notify other components of table changes. |
We have been porting the component on the v1-beta branch. We reimplemented it from the ground-up. While we haven't tested it, I think that the issue is most likely fixed on that branch. Hence, I'm closing it. |
Problem description
I have a table where I show some items and a click on the item reveals a Drawer with the item details. Unfortunately the selected row instantly get's deselected when the Drawer ist shown.
Steps to reproduce
selectable={true}
andonRowSelection={myOnSelectFunction}
deselectOnClickaway={false}
to TableBodymyOnSelectFunction
show a Drawer==> Drawer is shown BUT selected Row gets deselected right away
Expected behavior
...
==> Drawer is shown AND selected row remains selected. (So I can update the details if another item is selected or deselect the row when Drawer is dismissed)
Versions
The text was updated successfully, but these errors were encountered: