-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[TableBody] Fix row selection re-render bug #5884
Conversation
That sounds good to me. Also, it would be good to have a unit test for that issue. Thanks. |
Non-selection related table re-rendering previously caused the user's selection to be lost because the state was being reset unnecessarily. I took the opportunity to remove the prescient `TODO` comment that did correctly predict that this might be a problem.
14a0c0a
to
8bdc527
Compare
Hi @oliviertassinari, I've created a test but it doesn't actually work at present: clicking the first checkbox has no effect, whereas clicking the check-all checkbox works fine. Is there any chance this is because the test is synchronous but relies on asynchronous behaviour, or something like that? |
I'm not sure what's your issue it. I would rather add more tests to the |
The However, that doesn't help the fact the test environment did not appear to be working as expected -- the checkboxes would not actually check as expected? |
That could be artificialy simulated with the
That's most likely linked to how the test is writen. |
Did this issue be fixed in 0.16.7? |
Hi @dennischen, yes I can confirm it's in |
I try to build a simple single selectable list (without checkbox)
the problem is when selected changes to false , the table still kept the selection. (I printed the condition in monitor name column to compare) |
I am using the Table component of react "Material-UI v1.0.0-beta.10". In the demo, select all checkbox is working fine, But when I tried to implement it's not working. And I tried to use "multiSelectable" and "selectable" from previous version, after that too it's not working. Can you please help me fix this issue? Below is the code: import React from 'react'; const columnData = [ class EnhancedTableHead extends React.Component {
} EnhancedTableHead.propTypes = { const toolbarStyles = theme => ({ class EnhancedTableToolbar extends React.Component {
}; EnhancedTableToolbar = withStyles(toolbarStyles)(EnhancedTableToolbar); const styles = theme => ({ class EnhancedTable extends React.Component {
} EnhancedTable.propTypes = { export default withStyles(styles)(EnhancedTable); |
Non-selection related table re-rendering previously caused the user's
selection to be lost because the state was being reset unnecessarily.
I took the opportunity to remove the prescient
TODO
comment that didcorrectly predict that this might be a problem.