Skip to content

[Bug]: data table expandable prop does not work to dynamically make rows expandable #17612

Open

Description

Package

@carbon/web-components

Browser

Chrome

Package version

2.11.1

React version

18.2.0

Description

In our use case we would like only some rows to be expandable. The storybook docs mention

In case you only want to set specific rows to be expandable, be sure to set the expandable prop only on that specific component, and have its adjacent sibling directly following it.

I've tried this a few different times with and without sorting / other props we've added and I can't get it to work. Setting expandable for the entire data-table works, but then there are rows that won't have content within the expandable section which isn't what we want.

It was also pointed out by @ariellalgilmore

This looks to be a bug unfortunately. I would also expect the expandable buttons shouldn't be visible if there are no even with the expandable prop

Reproduction/example

https://stackblitz.com/edit/github-kbd9xw-xb63ek?file=index.html

Steps to reproduce

  1. Open the link
  2. View the code in index.html that is authored using the format storybook docs suggest (setting expandable on a specific row with an adjacent sibling expanded row following it)
  3. View the output that does not have one expandable row and one "normal" row.

Suggested Severity

Severity 2 = User cannot complete task, and/or no workaround within the user experience of a given component.

Application/PAL

watsonx Assistant

Code of Conduct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    Projects

    • Status

      🕵️‍♀️ Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions