-
-
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
Allow directives (actions/transitions/animations) to be more dynamic #6942
Comments
Related #6754 |
Not directly an issue with Svelte itself, but... If this gets merged and lets you apply testing-library/svelte-testing-library#206 {#if import.meta.env.VITEST}
<div data-testid="alert" role="alert">
....
</div>
{:else}
<div
data-testid="alert"
role="alert"
transition:fly
>
....
</div>
{/if} notice the transition can only be applied if not in VITEST env, if any kind of transition: directive is applied the tests will fail |
This would still be really nice, actions are super-powerful but weirdly static compared to how reactive the rest of svelte is currently. |
It would be great if we could also have an imperative transition API as an escape hatch for advanced use cases. I would really like to have manual control over:
Now these framework features are exclusive to transitions. Having an explicit API would open many possibilities for library authors. |
Describe the problem
Svelte encourages reactivity at many levels, but when it comes to actions, transitions, or animations, it's rather static:
Describe the proposed solution
Support swapping out directives
Alternatives considered
Workaround code involving
#if
sImportance
nice to have
The text was updated successfully, but these errors were encountered: