question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Transitions break basic functionality

See original GitHub issue

Sorry for the vague title. It’s late.

Using transitions seems to break basic functionality in some circumstances. By basic functionality I mean a simple if clause in the template, like so:

{#if condition}
   <Child/>
{/if}

…where the <Child/> is using transitions.

Reproduction: https://svelte.dev/repl/2e801ddf39f646709a3aa1b74f727f71?version=3.6.5

Instructions (also included in the REPL):

  1. Click the button to show the child component
  2. Write something in the input to reveal (with an animation) the close-button
  3. Click the close button and observe how the app breaks (not closing the child component)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
RedHattercommented, Feb 1, 2020

I made a minimal repel and traced down the problem.

During the outro svelteIsBroken is updated causing the update function of the fragment to be called which in turn calls transition_in on the if block ending the outro before it’s able to remove the component.

p: function update(ctx, [dirty]) {
	if (/*show*/ ctx[1]) {
		if (if_block) {
			if_block.p(ctx, dirty);
			transition_in(if_block, 1);
                ....
i: function intro(local) {
	if (current) return;
	if (div_outro) div_outro.end(1);
	current = true;
},

I’ve made a few simple attempts to solve it without success. I’m not sure how to fix this short of disabling the outro’s ability to be canceled all together.

@Conduitry Any ideas? Or should we give Rich a ping?

Edit: I should mention that this issue is a blocker at my work.

1reaction
Conduitrycommented, Jul 9, 2019

This appears to still be present in 3.6.6.

Read more comments on GitHub >

github_iconTop Results From Across the Web

transition - CSS: Cascading Style Sheets - MDN Web Docs
The transition CSS property is a shorthand property for transition-property, transition-duration, transition-timing-function, ...
Read more >
Types of Editing Transitions in Film — The Ultimate Guide
We're going to break down a variety of different types of editing transitions in film with examples from cinema history.
Read more >
An Interactive Guide to CSS Transitions - Josh W Comeau
This comprehensive guide shows how to use CSS transitions! A back-to-basics look at the fundamental building blocks we need to create ...
Read more >
Every Editing Transition Explained [The Shot List, Ep 9]
Creative video transitions and scene transitions explained, including J cut, match cut, fade in and more.Ultimate Guide: Editing Transitions ...
Read more >
Video transitions effects & examples - Biteable
A dissolve overlaps two shots or scenes, gradually transitioning from one to the other. It's usually used at the end of one scene...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found