-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
@storybook/addon-knobs not rendering Dropdowns and Text areas as expected in 4.0.0 #4621
Comments
Re: dropdowns, you're absolutely right, that was it. #4560 was the duplicate to your issue and I made the fix earlier (#4586), it just hasn't landed in Re: text knob, I'm not sure I get what you mean? The text is escaped (and probably should). If you're talking about the output in the story itself being escaped instead of showing as a rendered list, try this out as opposed to withKnobsOptions({
escapeHTML: false,
}) |
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks! |
This got fixed in |
When I started updating
@storybook/addon-knobs
version to4.0.0
, observed some issues with Dropdowns and Text areas ofaddon-knobs
.Issue with Dropdowns:
I am trying to do something like below:
import { select } from '@storybook/addon-knobs';
And in my story, I am adding knobs with dropdowns like:
select('Dropdown 1', ['', 'top', 'bottom'], 'top')
Here I am using options of
Array type
. On using options ofArray type
, the rendered dropdowns just have a output ofk
value like below:If I use options of
Object
type then it works fine. It does not work fine withArray
type only. I guess that is happening because of thereduce
function used in the file@storybook/addon-knobs/src/components/types/Select.js
like:options.reduce((acc, k) => Object.assign(acc, { k }), {})
Issue with TextAreas:
I am trying to do something like below:
import { text } from '@storybook/addon-knobs';
And in my story, I am adding knobs with text areas like:
text('message', '<ul><li>This is some lorem ipsum foo bar content.</li></ul>')
Above text is not escaping the
html tags
. Screenshot for the same is:The text was updated successfully, but these errors were encountered: