Skip to content
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

Svelte component doesn't displayed #8384

Closed
PritulaRoman opened this issue Oct 11, 2019 · 10 comments
Closed

Svelte component doesn't displayed #8384

PritulaRoman opened this issue Oct 11, 2019 · 10 comments

Comments

@PritulaRoman
Copy link

Describe the bug
Using Centered addon in Svelte stories leads to an empty screen. No component displayed.

To Reproduce
devDependencies

}
  "svelte": "^3.12.1",
  "@storybook/svelte": "^5.2.1",
  "@storybook/addon-centered": "^5.2.3"
}

You can see the issue on the Live Examples Svelte page

Screenshots
image

@jerriclynsjohn
Copy link
Contributor

I'm facing the exact same issue too.

@stale
Copy link

stale bot commented Nov 3, 2019

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@aromanarguello
Copy link
Contributor

Hi, is there anyone working on this? I Would like to see if I can contribute? It would be my first contribution to Open source.

@shilman
Copy link
Member

shilman commented Nov 7, 2019

@aromanarguello AFAIK nobody's working on this, and we'd love your help. please hop on our discord if you need any help getting started! https://discord.gg/UUt2PJb

@alexdilley
Copy link

alexdilley commented Nov 18, 2019

This is presumably because Svelte storybooks don't currently support using templates in a story, and this addon wraps the original component via a slot.

@aromanarguello
Copy link
Contributor

@alexdilley Hey! I was trying to investigate this and that is what I found as well, that the problem is that the component data is not being slotted into the wrapper. I'm not an expert as svelte, do you have any alternative ideas to fix this?

@alexdilley
Copy link

I guess either wait for support to be added to Storybook or perhaps style the root element (ofc this is global to all stories though):

#root {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

There's theming support but it doesn't seem to extend to adding arbitrary styles to the main frame.

@tonai
Copy link
Contributor

tonai commented Feb 3, 2020

I also face the same issue and here my investigations:

The centered addon decorator is set up using the Wrapper option here

Then this Wrapper option is converted to a Svelte component here

And the problem is that it uses a slots option to pass down the story component that will be wrapped by the centered decorator. This option is not documented anywhere in the Svelte docs

This option seems to exist in svelte 2 but was removed in Svelte 3.
There is an issue about this problem on the Svelte repo and there is also a PR created on May the 5th 2019.
This has still not been merged but in the original issue someone proposed a workaround that seems to work.

Maybe we should make use of that workaround.

I Will try to make a PR

@shilman
Copy link
Member

shilman commented Feb 4, 2020

w00t!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.0.0-alpha.5 containing PR #9724 that references this issue. Upgrade today to try it out!

You can find this prerelease on the @next NPM tag.

Closing this issue. Please re-open if you think there's still more to do.

@shilman shilman closed this as completed Feb 4, 2020
@shilman
Copy link
Member

shilman commented Feb 4, 2020

Jeepers creepers!! I just released https://github.com/storybookjs/storybook/releases/tag/v5.3.11 containing PR #9724 that references this issue. Upgrade today to try it out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants