Hello!
Thanks for all the work done on Storybook, it's amazing!
When adding a decorator to wrap the story in the preview iframe, the decorator gets added multiple times.
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!
@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.
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
@nextNPM tag.