-
Notifications
You must be signed in to change notification settings - Fork 15
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
fix(mantine, table): fix a few bugs when table is disabled by fieldset #3272
Conversation
Dependency Review✅ No vulnerabilities or license issues found.Scanned Manifest Files |
2cafec0
to
9cbd4b6
Compare
onClick={() => | ||
rowRef.current.querySelectorAll('.mantine-Table-root input[type=checkbox]:disabled').length > 0 | ||
? undefined | ||
: row.toggleSelected() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Row selection should still be enabled even when inside a disabled fieldset in some cases. Some row actions are still valid even in read-only mode.
For example, we often have a table row action that opens another panel to view the details of the resource represented by the row. Even if the table is disabled you still want to be able to view the resource's details.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see! From the examples in tanstack, I seem to have understood that row selection was for selecting and toggling the checkboxes associated to a row.
I'm not sure I understand the example completely. Are these details hidden inside a collapsible? Something like in the Sources panel?
If that's the case, if I'm not mistaken, this content becomes visible only when the user clicks on the arrow button and not on the row itself. The change here shouldn't affect access to the resource's details.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have an example of what I am referring to in your screenshot. In the table actions, we can see "Rescan", "Edit", "Activity", "... More". Those buttons still need to be activated even inside a disabled fieldset
. Granted, not all of them, but the "Activity" one does, and the "... More" as well. The predicate filter and the text search filter too still need to be functional.
Another concern of mine is sorting, what happens if you want to sort a table that is inside a disabled fieldset. Tables are more often than not presentational components rather than form control. |
I absolutely agree with the fact that tables are more often presentational, which is why I think that everything should remain visible to the user even when it is disabled. When testing the component with a |
Closed because the description of the task has changed. |
Proposed Changes
This PR tackles a few bugs that arise when a
Table
component is wrapped inside afieldset
. Essentially:Bug.B.mov
The changes made to fix the bugs are the following:
onClick
method of the rows to take into account if its checkbox is disabled or not. If it is, thenonClick
is undefined;NOTE: Currently, there is also a bug with the Pagination and the PerPage component that is in a
Table
's footer. More precisely, these components are disabled and unclickable. This is an issue because users should still be able to view the items inside a table and be able to manipulate these components. This task was created to tackle it.Potential Breaking Changes
None
Acceptance Criteria