Open rwibm opened 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
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:
TreeView (show code is very minimal and uses a function called "renderTree" that is not mentioned anywhere else, really not helpful! [note: you can still see a complete example in the "playground" section at the bottom, but that's not very user-friendly when the first 3 examples use an undefined helper function])
Modal (still mentions the old "bx" prefix in several places)
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