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

fix(Datagrid): look for id from data for initially expanded rows #5334

Conversation

matthewgallo
Copy link
Member

@matthewgallo matthewgallo commented May 23, 2024

Closes #5263

The current implementation for initially expanded rows is somewhat flawed in that it only looks for the id assigned from the react-table row. This update will also check if a provided id from initialState.expandedRowIds exists within the user provided data (the original row data).

What did you change?

packages/ibm-products/src/components/Datagrid/Extensions/NestedRows/NestedRows.stories.jsx
packages/ibm-products/src/components/Datagrid/useNestedRows.js
packages/ibm-products/src/components/Datagrid/utils/makeData.js

How did you test and verify your work?

I passed an id to initialState.expandedRowIds that exists on the original row and verified the associated row is still initially expanded.

@matthewgallo matthewgallo requested a review from a team as a code owner May 23, 2024 20:17
@matthewgallo matthewgallo requested review from elycheea and annawen1 and removed request for a team May 23, 2024 20:17
Copy link

netlify bot commented May 23, 2024

Deploy Preview for carbon-for-ibm-products ready!

Name Link
🔨 Latest commit d4e90ba
🔍 Latest deploy log https://app.netlify.com/sites/carbon-for-ibm-products/deploys/6671c7138252ba00087719c2
😎 Deploy Preview https://deploy-preview-5334--carbon-for-ibm-products.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@annawen1 annawen1 added this pull request to the merge queue Jun 21, 2024
Merged via the queue into carbon-design-system:main with commit 1ad9bbb Jun 21, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants