storybookjs/storybook

[Bug]: Angular signal inputs that are aliased don't work properly

Open

#29,697 创建于 2024年11月24日

在 GitHub 查看
 (6 评论) (10 反应) (0 负责人)TypeScript (10,058 fork)batch import
angularbughelp wantedsev:S3

仓库指标

Star
 (89,909 star)
PR 合并指标
 (平均合并 9天 3小时) (30 天内合并 173 个 PR)

描述

Describe the bug

Angular allows to alias inputs, for example when kebab-case attribute names are desired (see here). When I do so and assign such attribute a value in the args list then it seems the signal isn't getting the correct value (InputSignal<string>) but the value itself directly.

Related to #25784 and PR #26413

Reproduction link

https://stackblitz.com/edit/github-gh38gu

Reproduction steps

  1. Go to above link
  2. Navigate to the story Example\Button\Works
  3. Open Devtools' console which will not show errors about backgroundColor (which is aliased)
  4. Navigate to the story Example\Button\Broken
  5. In Devtools' console there will be error messages about backgroundColor only. The attribute foregroundColor is not mentioned and the only difference is it not being aliased in the component.
ERROR TypeError: ctx.backgroundColor is not a function
    at ButtonComponent_Template (template.html:6:3)

The broken story defines both attribute in the args, that seems to "activate" the difference.

System

Storybook Environment Info:

  System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.20.3 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm <----- active
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    @storybook/addon-docs: ^8.5.0-alpha.10 => 8.5.0-alpha.10 
    @storybook/addon-essentials: ^8.5.0-alpha.10 => 8.5.0-alpha.10 
    @storybook/addon-interactions: ^8.5.0-alpha.10 => 8.5.0-alpha.10 
    @storybook/addon-onboarding: ^8.5.0-alpha.10 => 8.5.0-alpha.10 
    @storybook/angular: ^8.5.0-alpha.10 => 8.5.0-alpha.10 
    @storybook/blocks: ^8.5.0-alpha.10 => 8.5.0-alpha.10 
    @storybook/test: ^8.5.0-alpha.10 => 8.5.0-alpha.10 
    storybook: ^8.5.0-alpha.10 => 8.5.0-alpha.10

Additional context

No response

贡献者指南