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

skipIntroByDefault only works in top-level components #1475

Closed
jacwright opened this issue May 16, 2018 · 6 comments
Closed

skipIntroByDefault only works in top-level components #1475

jacwright opened this issue May 16, 2018 · 6 comments

Comments

@jacwright
Copy link
Contributor

If transitions are deeper than the top-level component then they get run on startup. See:

https://svelte.technology/repl?version=2.6.2&gist=b875329d846ecad0201bcfa62d6d1230

In addition, the slide transition in the above example should never run. It should be scoped to the {#if visible} block within the inner component and only run when Component1’s visible property is toggled, not when App’s visible property is toggled to show Component1. If it isn't scoped to the nearest if or each then animations will only skip at app startup but will run on new page routes. This is undesirable.

@Rich-Harris
Copy link
Member

I think this is a dupe of #1460 ?

@jacwright
Copy link
Contributor Author

jacwright commented May 16, 2018

Should this be altered to address the second part of the issue only (the animation being run when the checkbox is clicked)? Or are the two issues the same underlying problem?

@Rich-Harris
Copy link
Member

The second part is the missing piece of #1451. Quoting from there:


...introduce some mechanism for preventing child transitions — I suggested this previously:

<!-- it would be weird if each <li> slid out while the <ul> itself was fading -->
{#if showList}
  <ul transition:fade childtransition:false>
    {#each list as item (item.id)}
      <li transition:slide>{item.name}</li>
    {/each}
  </ul>
{/each}

We need nested transitions, but we also need a way to prevent them. That seems like the most reasonable design to me. Thoughts?

@jacwright
Copy link
Contributor Author

That makes sense, however I believe the default should prevent child transitions as that will be a vast majority of the cases. I will add my thoughts in #1431 since that is where the discussion is. Thanks!

@Rich-Harris
Copy link
Member

#1431 is closed; this probably warrants a new issue

@jacwright
Copy link
Contributor Author

Opened #1480

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