-
Notifications
You must be signed in to change notification settings - Fork 934
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
[QUESTION] onRowClick custom action seems to override default action of selectableRowsOnClick #765
Comments
Hi Gabriel! Could you share your example? It seems to work as i expected. Thank you very much! |
Thank you for that example, I was able to confirm the bug, though the answer here might be a bit different than you were expecting. So, the first problem is the However, you will still have an issue with disappearing selections past this point if you are not careful. The issue arises when you are using these callbacks to set state. Changing the state will trigger a re-render that will then default back to your props. So what you'd need to do is track your selected rows like so:
You'll map the selected rows differently if it's |
|
Hi Gabriel! Here is the sandbox: https://codesandbox.io/s/smoosh-leaf-4rgmd Thank you very much!! |
When you use the option "onRowClick" to provide a custom action (or function), seems to override the default function of "selectableRowsOnClick" when its true.
Expected Behavior
When calling a custom function in the "onRowClick" option, it doesnt override, the default function of "selectableRowsOnClick" (when its true). It triggers the check of the checkbox, renders the select toolbar, and then, triggers the custom function.
Current Behavior
When i call a custom function, it doesnt triggers the default function of "selectableRowsOnClick" (check checkbox, renders select toolbar, etc.), it seems to override it, instead of "adding".
Steps to Reproduce
Environment
The text was updated successfully, but these errors were encountered: