Open jaydenseric opened 1 year ago
It could also be argued that it's a bug that the exact same parameter information displays multiple times:
Identical variations of the same parameter name could be deduplicated.
Also, the parameter type is not rendered! It's important information, and if it was displayed, it would be clear why there are multiple rows rendering with the same parameter name.
Describe the bug
The args table that renders in story the docs page and in the story controls panel (when in mode
expanded: true
) has 3 issues when rendering in a sub table displayable parameters for a JSDoc based arg here:https://github.com/storybookjs/storybook/blob/8580060e7c1bcfd7e1079cf0d440cf29bb88ef60/code/ui/blocks/src/components/ArgsTable/ArgJsDoc.tsx#L93-L103
All 3 issues can be seen in this one screenshot of how the Material UI React component
TextField
props render:When multiple parameters being looped have the same
name
, it causes a React render warning about duplicate keys, e.g:Multiple parameters can have the same name when the type has multiple possibilities:
In this example, here are where the 3 possibilities are defined:
Each parameter's description Markdown is not rendered as HTML.
The HTML table structure is not accessible / semantically correct, because a
<td>
is used instead of a correct<th scope="row">
for the header cell.To Reproduce
Make stories for the Material UI React component
TextField
and view how the proponChange
renders in the story args table in the docs page and in the story controls panel (when in modeexpanded: true
).Because Storybook refuses to docgen for components originating in
node_modules
, you will have to wrap the componentTextField
in a local project module and use that for the stories.System
Additional context
Possibly related: https://github.com/storybookjs/storybook/issues/14481