Skip to content
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 Select knobs with long list is crashing #3

Open
sreeg123 opened this issue Apr 26, 2021 · 2 comments
Open

Storybook Select knobs with long list is crashing #3

sreeg123 opened this issue Apr 26, 2021 · 2 comments

Comments

@sreeg123
Copy link

Select knob with long list options when an option is selected then the page is crashing, will need to reload.

To Reproduce

<Meta
title="Foundations/Icons/Iconography"
decorators={[
withKnobs({
escapeHTML: false
}),
moduleMetadata({
imports: [CommonModule, IconModule]
})
]}
parameters={{
a11y: { ...a11yConfig, element: 'icon' }
}}
/>

export const iconsList = [
{
label: 'vanguardLargeLogo white',
name: 'vanguardLargeLogo',
class: 'vanguardLogoWhite'
}, ........................
]

<Canvas mdxSource={<icon [icon]="iconData"></icon>}>

{{
template: <icon [icon]="iconData"></icon>,
props: {
iconData: select('Icon', iconsList, iconsList[0])
}
}}

System
"@storybook/addon-knobs": "~6.2.3",
Angular - v11.2

Additional context
This code is crashing only after upgrading to Angular 11 from angular 9 and storybook 6.2

@shilman
Copy link
Member

shilman commented Apr 26, 2021

FYI, we’ve released addon-controls in Storybook 6.0. Controls are portable, auto-generated knobs that are intended to replace addon-knobs, which are slated for deprecation.

Please upgrade and try out controls today!

@sreeg123
Copy link
Author

Tried controls, i can see the select control but can not tie the control value to template, Can you please let me know what i am missing, Thank You!

<Meta
title="Foundations/Icons/SVG"
decorators={[
moduleMetadata({
imports: [CommonModule, SvgModule]
})
]}
parameters={{
a11y: { ...a11yConfig, element: 'svg' }
}}
argTypes={{
icon: {
control: {
type: 'select',
options: ['vuiInternalCallout', 'vuiArrow' ]
}
}
}}
/>

export const svgTemplate = (args, { argTypes}) => ({
template: <svg [name]="icon"></svg>,
props: Object.keys(argTypes)
});

<Canvas
mdxSource={<svg [name]="icon"></svg>}

<Story name="SVG" height="250px" args={{icon : 'vuiArrow'}}>
{svgTemplate .bind({})}

@shilman shilman transferred this issue from storybookjs/storybook May 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants