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
Our Angular component expects that ngOnChanges is called at initialization time and the view is correctly updated according to the initial input.
The actual behavior is that while ngOnChanges is called, the view is not updated.
Had the same issue, but it's actually resolved since version 6.3.16 (#17156).
Since you'r on the alpha version, I guess there's some merging required to make this fix available.. I'm not aware of how it works, but I guess you'll soon get a new version that comes with it. 😄
I can reproduce this issue on the latest stable version of Storybook. (I'm using Storybook 6.4.19 with Angular 12.1.0).
I've forked @Quetute's demo and updated it to the latest stable version of Storybook, and I can reproduce the issue there as well. Possibly related: #17492
We’re cleaning house! Storybook has changed a lot since this issue was created and we don’t know if it’s still valid. Please open a new issue referencing this one if:
Describe the bug
Our Angular component expects that ngOnChanges is called at initialization time and the view is correctly updated according to the initial input.
The actual behavior is that while ngOnChanges is called, the view is not updated.
From Angular documentation:
Our component rely on this behavior to not have to execute the same code twice in ngOnInit and ngOnChanges.
To Reproduce
https://github.com/Quetute/storybook-angular-initial-input-issue
System
Environment Info:
System:
OS: macOS 11.6
CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
Binaries:
Node: 16.13.0 - /usr/local/bin/node
Yarn: 3.1.1 - /usr/local/bin/yarn
npm: 8.1.4 - /usr/local/bin/npm
Browsers:
Chrome: 97.0.4692.99
Firefox: 95.0.2
Safari: 14.1.2
npmPackages:
@storybook/addon-actions: ^6.5.0-alpha.23 => 6.5.0-alpha.23
@storybook/addon-docs: ^6.5.0-alpha.23 => 6.5.0-alpha.23
@storybook/addon-essentials: ^6.5.0-alpha.23 => 6.5.0-alpha.23
@storybook/addon-links: ^6.5.0-alpha.23 => 6.5.0-alpha.23
@storybook/angular: ^6.5.0-alpha.23 => 6.5.0-alpha.23
@storybook/builder-webpack5: ^6.5.0-alpha.23 => 6.5.0-alpha.23
@storybook/manager-webpack5: ^6.5.0-alpha.23 => 6.5.0-alpha.23
Additional context
As a workaround, we could copy the logic in the ngOnInit hook and add a check in ngOnChanges that rely on the SimpleChange.isFirstChange() method.
The text was updated successfully, but these errors were encountered: