carbon-design-system / ibm-products

A Carbon-powered React component library for IBM Products
https://ibm-products.carbondesignsystem.com
Apache License 2.0
94 stars 137 forks source link

[Datagrid]: Filtering with nested rows does not work as expected #5443

Closed flannanl closed 2 months ago

flannanl commented 3 months ago

Package

Carbon for IBM Products

Description

There are a few issues with filtering / search capability with nested rows in Datagrid. This can be easily reproducible with the storybook example: https://carbon-for-ibm-products.netlify.app/?path=/story/ibm-products-components-datagrid-nestedrows--single-level-nested-rows-usage-story.

Using the storybook example: 1) If I search for a string appearing in the parent row, I see only the parent row to appear. I would expect the children rows should be appeared as well since they are part of the hierarchy. 2) Continue from (1) above, if I clear the search text, I would expect the filtered children rows to reappear, but they do not. Those children rows are simply lost and I have no way to bring them back unless I do a page reload on the storybook example. 3) If I search for a string appearing only in the children row, I am not seeing that row appeared in the filtered results. I would expect I will see the filtered rows in the children rows with its parent showing up.

Component(s) impacted

This is an issue with Datagrid component. And here are some screenshots of what I have tried.

1) First and second issue:

2) Third issue:

Browser

No response

@carbon/ibm-products (previously @carbon/ibm-cloud-cognitive) version

v1.73.1

Severity

Severity 2 = Aspects of design is broken, and impedes users in a significant way, but there is a way to complete their tasks. Affects major functionality, has a workaround.

Product/offering

IBM Cloud Projects

CodeSandbox or Stackblitz example

https://carbon-for-ibm-products.netlify.app/?path=/story/ibm-products-components-datagrid-nestedrows--single-level-nested-rows-usage-story&globals=viewport:basic

Steps to reproduce the issue (if applicable)

No response

Release date (if applicable)

No response

Code of Conduct

matthewgallo commented 3 months ago

Hey @flannanl, this sounds like a duplicate of https://github.com/carbon-design-system/ibm-products/issues/4652. Can you confirm? Thanks!

flannanl commented 3 months ago

@matthewgallo I think the core problem is the same. But mine requests for a behavioural change to the filtering as well, which I think it's not fully related to the core problem.

filipmadejIBM commented 3 months ago

We experience same issue, search doesn't work for nested rows.

davidmenendez commented 3 months ago

for design consideration: how add & select works when filtering

matthewgallo commented 2 months ago

This seems to be a similar issue that was reported in #4652, see the appropriate fix here.