Storybook: Decorator gets added multiple times

Created on 26 Sep 2018  路  3Comments  路  Source: storybookjs/storybook

Hello!
Thanks for all the work done on Storybook, it's amazing!

Bug summary

When adding a decorator to wrap the story in the preview iframe, the decorator gets added multiple times.

Steps to reproduce

WrapperElement is a Vue component that has the following template:

<div class="wrap">
   <slot/>
</div>

Adding it to wrap a story in it:

storiesOf('Button', module)
  .addDecorator(WrapperElement)
  .add('Default', () => ({
    components: { MyButton },
    template: '<MyButton>My button</MyButton>'
  }));

I get:

<div class="wrap">
   <div class="wrap">
      <div class="wrap">
         <button>My button</button>
      </div>
   </div>
</div>

instead of:

<div class="wrap">
   <button>My button</button>
</div>

I use @storybook/vue 4.0.0.alpha22. This bug also happens if I use the centered addon or if I add the decorator globally for all my stories.
Am I missing something?

Thanks!

vue bug decorators

Most helpful comment

Ta-da!! I just released https://github.com/storybooks/storybook/releases/tag/v4.2.0-alpha.6 containing PR #5057 that references this issue. Upgrade today to try it out!

Because it's a pre-release you can find it on the @next NPM tag.

All 3 comments

@sdussaut that should not be happening, definitely a bug

I created a PR for this issue in #4846.

Ta-da!! I just released https://github.com/storybooks/storybook/releases/tag/v4.2.0-alpha.6 containing PR #5057 that references this issue. Upgrade today to try it out!

Because it's a pre-release you can find it on the @next NPM tag.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

arunoda picture arunoda  路  3Comments

sakulstra picture sakulstra  路  3Comments

dnlsandiego picture dnlsandiego  路  3Comments

rpersaud picture rpersaud  路  3Comments

zvictor picture zvictor  路  3Comments