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
Here I am using options of Array type. On using options of Array type, the rendered dropdowns just have a output of k value like below:
If I use options of Object type then it works fine. It does not work fine with Array type only. I guess that is happening because of the reduce 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:
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 4.0.0.
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 withKnobs:
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!
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: