-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Transitions in custom Elements #1825
Comments
Still not working in sveltev3. |
this is a big big big bug,not only Transitions but also <style></style> not work |
The reason is that the So, line 32, which is However, currently, the function doesn't have a Although performance-wise not the best solution, there is a cleaner alternative: function find_root(element) {
const parent = element.parentNode;
return parent
? parent.head
? parent.head
: find_root(parent)
: element;
} If a function like the one above is added to the style-manager, then line 32 can be changed into this: find_root(node).appendChild(style); Another alternative might be replacement of line 32 at compile time by the compiler. Performance would then be OK. An final option I could think of is doing the same replacement via a custom element transition loader for module bundlers like Rollup and Webpack, but that means additional and repetitive work for something that should already be present within the compiled output. 🤷♂️ |
As long as the PR #4998 is still open you can use the build script in the custom-elements template that I created. It fixes the transition using Custom element template: https://github.com/redradix/svelte-custom-element-template |
I spent some time today with this, and made a work-around using https://github.com/akauppi/sv-keys/blob/master/src/tools/slideFixed.js#L32-L40 TL;DR It's a custom transition and while
|
Until a PR fixing this becomes merged, I've made a tiny workaround that allows transitions to work with custom elements in at least simple cases, available here: https://github.com/Auroratide/svelte-custom-element-transitions Sharing here in case anyone else finds it useful! |
Seems like there is a problem with svelte-transitions in customElements, js works properly, adding css: animation, right before destroy, but there are no visual effects...
Seems like it can`t set animation for Shadow CSS.
The text was updated successfully, but these errors were encountered: