-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
[Bug]: Storybook issue with Angular Signals input #28412
Comments
I don’t think we at Storybook can do much about it. Let’s upvote compodoc/compodoc#1491 which hopefully fixes the issue in compodoc! |
So the compodoc bug was merged (compodoc/compodoc#1491 (comment)), I think Storybook now needs a dependency update as soon as its released? |
Sure! Hopefully compodoc is releasing soon-ish a new version. |
I'm waiting for the releasing of the new version too |
Can you explain why compodoc is required for this? BTW, it seems to be there was no release since May 2024... |
Also waiting for this to be Fixed. Any Updates on this? |
Compodoc was released last month, are there any plans to update the dependency? |
But it does not include the fix: compodoc/compodoc#1491 |
Describe the bug
Storybook does not properly support Angular Signal inputs. When creating a story with a component that uses the new Signal input as an input property, in the control tab of the story the type is not displayed properly (instead, only "Set string" input field is shown.)
In this screenshot you can see the difference how Storybook properly handles an @ Input() property but is unable to properly show the type of a Signal input (e.g. `testSignalsInput = input<'a' | 'b' | 'c' | undefined>(undefined);). In this scenario, both controls should actually be displayed in the same way (providing radio buttons with 'a', 'b' and 'c').
The test component in this scenario looks like this:
`import { Component, Input, input } from '@angular/core';
@component({
selector: 'app-test',
standalone: true,
imports: [],
template:
<p> test works! </p>
,styles: ``,
})
export class TestComponent {
testSignalsInput = input<'a' | 'b' | 'c' | undefined>(undefined);
@input()
testInput?: 'a' | 'b' | 'c' = undefined;
}
`
Overall, this seems to be an issue with the compodoc dependency. In this PR (#26413) the issue was already mentioned. This is the related compodoc conversation. *Not sure if this is purely a compodoc issue or also related to Storybook, but it's worth mentioning that Storybook is currently almost unusable with apps using Angular Signals (which is the new Angular standard for inputs).
Reproduction link
https://stackblitz.com/edit/github-fbjw2b?file=src%2Fapp%2Ftest%2Ftest.component.ts
Reproduction steps
This is the issue - when using Angular Signals, the user cannot select between predefined values anymore (like previously possible when using @ Input()), as shown in the Stackblitz example. The
testInput
andtestSignalsInput
properties should be shown to the user in the same way, but currently when using the new Angular input syntax (e.g. `testSignalsInput = input<'a' | 'b' | 'c' | undefined>(undefined);) only a string input will be shown in the Storybook control tab.System
Additional context
No response
The text was updated successfully, but these errors were encountered: