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

Enable API throw an error #1

Closed
diervo opened this issue Jul 19, 2024 · 2 comments
Closed

Enable API throw an error #1

diervo opened this issue Jul 19, 2024 · 2 comments

Comments

@diervo
Copy link

diervo commented Jul 19, 2024

I tried to debug it, but locally is minified and I just didn't have much time to dig into your plugin lifecycle.

version: 0.0.5

The following code:

this.swapy = createSwapy(propertiesContainer);
this.swapy.enable(true);

Throws:

Error: You can't call getPlugin for Swapy with key: undefined because it does not exist in your app
@diervo
Copy link
Author

diervo commented Jul 19, 2024

After some debugging seems to be due to the fact that Im instantiating Swapy inside a Shadow

@TahaSh
Copy link
Owner

TahaSh commented Jul 19, 2024

@diervo Thank you for reporting this issue. Unfortunately, Veloxi (which was used to create Swapy) only works directly on the DOM and can't be used with the shadow DOM. The only case I can think of where it might work with web components is if you are using item content as components. For example:

<div data-swapy-slot="1">
  <div data-swapy-item="a">
     <my-component></my-component>
  </div>
</div>

But that might not be what you want. Sorry! 😞

@TahaSh TahaSh closed this as completed Jul 24, 2024
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

2 participants