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
In Meta argsType property, if I dont force the control property of validateChange to something (function in my case) the function is not set in the WithValidator story and so the value stay undefined.
That issue is only for Input which are functions, so I set the control value to 'function' but in fact just the control property is needed.
I found the resolution by debugging the storybook sources in the browser. I find a function cleanArgsDecorator which check the arguments has either an action or a control property.
const cleanArgsDecorator = (storyFn, context) => {
if (!context.argTypes || !context.args) {
return storyFn();
}
const argsToClean = context.args;
context.args = Object.entries(argsToClean).reduce((obj, [key, arg]) => {
const argType = context.argTypes[key];
// Only keeps args with a control or an action in argTypes
if (argType.action || argType.control) {
return Object.assign(Object.assign({}, obj), { [key]: arg });
}
return obj;
}, {});
return storyFn();
};
If it is wanted to be like this for function please update the documentation to describe that case, else something is missing for Angular Inputs which are of type function.
To Reproduce
No response
System
No response
Additional context
No response
The text was updated successfully, but these errors were encountered:
Got the same issue with functions in stories being undefined, after a big haul upgrade from Angular 9 to 15 and latest Storybook (6.5.16). Stories that worked before started showing these errors: ctx.onClickHandler is not a function
Describe the bug
Example of component
Component
HTML
Stories
In Meta argsType property, if I dont force the control property of validateChange to something (function in my case) the function is not set in the WithValidator story and so the value stay undefined.
That issue is only for Input which are functions, so I set the control value to 'function' but in fact just the control property is needed.
I found the resolution by debugging the storybook sources in the browser. I find a function cleanArgsDecorator which check the arguments has either an action or a control property.
If it is wanted to be like this for function please update the documentation to describe that case, else something is missing for Angular Inputs which are of type function.
To Reproduce
No response
System
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: