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: web componet dynamic row changes #17895

Merged

Conversation

lee-chase
Copy link
Member

Closes #17894

Rows changed dynamically, e.g. by pagination, make the internals of cds-table stale. Specifically things like expandable are not persisted between pages.

Changelog

Changed

  • packages/web-components/src/components/data-table/stories/data-table-expansion.stories.ts - delay the rendering of the table rows for the Playground story to simulate changing rows at runtime.
  • packages/web-components/src/components/data-table/table-body.ts - raise cds-table-body-content-change from table body when the slot contents change.
  • packages/web-components/src/components/data-table/table.ts - update this._tableBody, this._tableExpandedRows, this._tableRows and re-run assigning expandable to rows on cds-table-body-content-change.

Testing / Reviewing

Verified in altered storybook story.

@lee-chase lee-chase requested a review from a team as a code owner October 28, 2024 13:39
Copy link

netlify bot commented Oct 28, 2024

Deploy Preview for v11-carbon-web-components ready!

Name Link
🔨 Latest commit 2bc1375
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-web-components/deploys/671f941aa131e6000890274a
😎 Deploy Preview https://deploy-preview-17895--v11-carbon-web-components.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.

Copy link

netlify bot commented Oct 28, 2024

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit 2bc1375
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/671f941ae52f940008037308
😎 Deploy Preview https://deploy-preview-17895--carbon-elements.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.

Copy link

netlify bot commented Oct 28, 2024

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 2bc1375
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/671f941ad83c5100085c73ab
😎 Deploy Preview https://deploy-preview-17895--v11-carbon-react.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.

Copy link

codecov bot commented Oct 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.49%. Comparing base (f4f3dfe) to head (2bc1375).
Report is 24 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #17895      +/-   ##
==========================================
+ Coverage   80.45%   80.49%   +0.04%     
==========================================
  Files         406      406              
  Lines       14041    14041              
  Branches     4347     4395      +48     
==========================================
+ Hits        11296    11302       +6     
+ Misses       2579     2572       -7     
- Partials      166      167       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kennylam kennylam added the package: @carbon/web-components @carbon/web-components label Oct 29, 2024
@kennylam kennylam requested review from emyarod, ariellalgilmore and annawen1 and removed request for alisonjoseph October 29, 2024 00:36
Copy link
Member

@ariellalgilmore ariellalgilmore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! also looks like it fixes this reported bug as well: #17660

@kennylam kennylam added this pull request to the merge queue Oct 30, 2024
Merged via the queue into carbon-design-system:main with commit 75c827d Oct 30, 2024
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: @carbon/web-components @carbon/web-components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Dynamically adding and removing rows from a web component table with expansion does not work
3 participants