carbon-design-system / carbon

A design system built by IBM
https://www.carbondesignsystem.com
Apache License 2.0
7.81k stars 1.8k forks source link

[Bug]: Storybook documentation for DataTable does not match the provided example code #14833

Open rwibm opened 1 year ago

rwibm commented 1 year ago

Package

@carbon/react

Browser

No response

Package version

1.38.0

React version

No response

Description

Some of the documentation pages include text that does not match the code examples shown by the "show code" buttons.

You can normally get away with figuring things out by looking at the source code for the stories, but for DataTable this gets confusing quick.

Examples: https://react.carbondesignsystem.com/?path=/docs/components-datatable-basic--overview

If you look on the example page above, you will see nearly all of the "show code" buttons only ever show the opening DataTable tag with the headers/rows props and nothing else, this is more obvious in the examples for "selection", "filtering", and "batch actions" as the description takes the user through the code, explaining what each part does, but doesn't actually show any of the code its explaining.

I've noticed a couple of other small documentation issues too:

Reproduction/example

https://react.carbondesignsystem.com/?path=/docs/components-datatable-selection--overview

Steps to reproduce

Visit any of the examples below, click on the "show code" button and see that all of the code has been omitted other than the list of headers/rows, which is probably the least useful part of the code for these particular examples.

Suggested Severity

None

Application/PAL

IBM Internal

Code of Conduct

tw15egan commented 1 year ago

@rwibm thanks for pointing those out! Seems like some sort of issue with the storybook docs addon. For now, you should be able to view the full code of each story by going to the bottom of the story page and hitting the code tab. https://react.carbondesignsystem.com/?path=/story/components-datatable-basic--default