Skip to content
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

Datagrid: add support for selectable nested rows #3887

Open
1 of 3 tasks
matthewgallo opened this issue Dec 1, 2023 · 2 comments
Open
1 of 3 tasks

Datagrid: add support for selectable nested rows #3887

matthewgallo opened this issue Dec 1, 2023 · 2 comments
Assignees
Labels
component: Datagrid type: enhancement 💡 New feature or request version: 1 Carbon 10 / v1 version: 2 Carbon 11 / v2

Comments

@matthewgallo
Copy link
Member

What package(s) are you using?

  • Carbon for IBM Products (or Carbon for IBM Cloud & Cognitive)
  • Legacy/CDAI
  • Legacy/Security

Detailed description

Describe in detail the issue you're having.

There current is not support for selected nested rows in the Datagrid, however there is design guidance for this variant of Datagrid, see here.

Is this issue related to a specific component?

Datagrid, useNestedRows and useSelectRows

What did you expect to happen? What happened instead? What would you like to
see changed?

Expected to be able to use these two plugins together.

What browser are you working in?

Chrome

What version of the @carbon/ibm-products (or @carbon/ibm-cloud-cognitive)
package are you using?

Latest

What offering/product do you work on? Any pressing ship or release dates we
should be aware of?

N/A

@matthewgallo matthewgallo added type: enhancement 💡 New feature or request component: Datagrid version: 2 Carbon 11 / v2 version: 1 Carbon 10 / v1 labels Dec 1, 2023
@github-project-automation github-project-automation bot moved this to Needs triage 🧐 in Carbon for IBM Products Dec 1, 2023
@elycheea elycheea moved this from Needs triage 🧐 to Needs refinement 🤓 in Carbon for IBM Products Dec 14, 2023
@elycheea
Copy link
Contributor

elycheea commented Dec 14, 2023

Acceptance criteria

  • Add a story with selectable rows under nested rows folder
  • Selecting parent should not select all children by default

From discussion on refinement call —
Safest route is probably to leave out selection of all children when selecting the parent. This behavior can vary depending on needs. Add select is another example that treats this a bit separately.

Updated Feb 19 — based on default behavior from React Table, we’ve decided to keep selection of nested children.

@matthewgallo
Copy link
Member Author

It appears that react-table forces all child rows to be selected when a parent row is selected, there might be a way to work around this but this appears to be the default behavior.

https://github.com/TanStack/table/blob/v7/src/plugin-hooks/useRowSelect.js#L166-L169

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: Datagrid type: enhancement 💡 New feature or request version: 1 Carbon 10 / v1 version: 2 Carbon 11 / v2
Projects
Status: Done 🚀
Development

No branches or pull requests

3 participants