-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Controls - type array of objects displayed wrongly #13503
Comments
You'll want to use We'll be providing a better UI for object controls in 6.2, and hopefully can do something for arrays as a followup there: #12824 |
@shilman Thanks a lot for the clarification. I would suggest to make a note in the docs regarding this case until a new version is released :) |
If all the objects in the array have the same keys, it could make sense to have a "table" display type (like the chrome |
I really like the As of Storybook 6.2, arrays are inferred to use the |
Closing this because the original bug (displaying |
Describe the bug
If use argTypes control type
array
for array of object, in the UI it will display [object Object] instead of proper value, because it tries to "serialize array into a comma-separated string inside a textbox" .To Reproduce
Steps to reproduce the behavior:
argTypes
of the component doc[object Object],[object Object],[object Object]
Expected behavior
It should display
{ text: "Home", link: "#" }, { text: "Category", link: "#" }, { text: "Pants", link: "#" }
Screenshots
System
Environment Info:
System:
OS: macOS 10.15.7
CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
Binaries:
Node: 14.13.0 - /usr/local/bin/node
Yarn: 1.22.5 - /usr/local/bin/yarn
npm: 6.14.8 - /usr/local/bin/npm
Browsers:
Chrome: 87.0.4280.88
Firefox: 76.0.1
Safari: 14.0
The text was updated successfully, but these errors were encountered: