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

Support for Web Components #310

Closed
ghost opened this issue Jan 14, 2019 · 12 comments
Closed

Support for Web Components #310

ghost opened this issue Jan 14, 2019 · 12 comments

Comments

@ghost
Copy link

ghost commented Jan 14, 2019

We are in troubles using Glide inside a Web Component, with LitElement.
Should be good in general if the library supports the possibility of place his HTML structure inside <slot> and so dealing with Shadow DOM and other Web Components features.
Rif:

Acctually the library seems to not support the presence of <slot> inside.

@johannesjo
Copy link

@mattiapontonio did you find a solution for this?

@ghost
Copy link
Author

ghost commented Feb 21, 2019

@johannesjo really not. By my side, the issue is now in charge to another developer so I'm not focused on that now.

@johannesjo
Copy link

@mattiapontonio ok thanks for getting back to me!

@alexghattas
Copy link

@mattiapontonio @johannesjo have either of you found a solution? 90% there, just having issues with Glide skipping the element on mount.

@johannesjo
Copy link

@alexghattas no sorry.

@alexghattas
Copy link

@johannesjo I was able to find a workaround for now. Had to make some small changes to the actual package files for now, but its working with the slotted items. Let me know if you're still stuck on this.

@johannesjo
Copy link

@alexghattas thanks. I don't really am (project is over, and we chose a different carousel). Pretty sure though that others might be interested :)

@kylerberry
Copy link

@alexghattas have you considered making a PR for your solution?

@alexghattas
Copy link

@kylerberry in the end, there was no need to manipulate the code of the package, we were able to use the events to get what we wanted.

@kylerberry
Copy link

kylerberry commented Jun 27, 2019

@alexghattas Good! I was just able to make a LitElement component that supports slottable content without modifying the source. For anyone interested: https://gist.github.com/kylerberry/51cf28565e434de410d6ebd337a2f962

html use:

<content-slider>
    <div slot="slide1">Hi! I'm going to be a slotted slide</div>
    <div slot="slide2">Me too!</div>
</content-slider>

@ghost
Copy link
Author

ghost commented Oct 17, 2020

Any updates here? Can I close the issue?

@ghost
Copy link
Author

ghost commented Oct 19, 2020

@alexghattas Good! I was just able to make a LitElement component that supports slottable content without modifying the source. For anyone interested: https://gist.github.com/kylerberry/51cf28565e434de410d6ebd337a2f962

html use:

<content-slider>
    <div slot="slide1">Hi! I'm going to be a slotted slide</div>
    <div slot="slide2">Me too!</div>
</content-slider>

Close with this workaround.
Thank You all.

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

No branches or pull requests

3 participants