You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[ButtonGroup]: stretch JSDoc says @default true, the component defaults it to false #1001
stretch JSDoc is incorrect. button-group.tsx:31 says @default true, but the component destructures stretch = false at button-group.tsx:79. The tedi-button-group--stretch class is applied only when the prop is truthy (button-group.tsx:173), and that modifier is the only thing giving the items flex: 1 (button-group.module.scss:120-124). A group rendered without the prop sizes its buttons to their content, which is the opposite of what the props table says.
Storybook builds the props table from these tags (reactDocgen: 'react-docgen-typescript', .storybook/main.ts:45), so the wrong default is published there too.
The two lines have never agreed in this repo. Both are already present in bc880e5, the commit that moved React to a standalone repo, and the three later commits to the file left them untouched. Still the case in 19.1.1 and on main.
Solution
Change the JSDoc to @default false. Non-breaking, and matches what the component does.
Or change the destructured default to true to match the documented intent. That changes the layout of every existing group that doesn't pass the prop, so it would need a major.
Render a group whose buttons have labels of different lengths and pass no stretch. The docs say the buttons take equal space; each one sizes to its label.
Activity