Skip to content

Transition out leaves invisible elements in the DOM after reassignment #6150

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

Closed
csangonzo opened this issue Mar 30, 2021 · 5 comments
Closed

Comments

@csangonzo
Copy link

Describe the bug
The bug comes out then I use the out:<any_svelte_transition> in a list of items ({#each}...{/each}).
When I reassign the array that I loop through with each and the data comes from a Promise and the data 'arrives' earlier then the out animation finishes, the previous data won't get removed from the DOM, it's going to be hidden, but it takes up the space unnecessarily.

image

To Reproduce
To reproduce try the example in this repl: https://svelte.dev/repl/7163b83de9b74b7b9d2a84560b73f6bd?version=3.36.0

  • Click on filter and you can see the overflow is still there and if you ispect the list container, you can see the previos data in there.

Expected behavior
The items should disappear from the dom also and should not take up the space.

  • Your browser and the version: Firefox, Edge, Chrome
  • Your operating system: Windows, Debian
  • Svelte version: 3.36.0
  • Rollup

Severity
Somewhat annoying when trying to filter an array of products and want to do it with a smooth animation.

@Kapsonfire-DE
Copy link
Contributor

I can confirm this bug. Tested a bit around and this happens when you modify during transition. See also #6152

@jrmoynihan
Copy link

I also can confirm this bug. It's actually layout-breaking because the "empty" leftover nodes are still getting counted as child elements in my grid layout. You can also repeat this infinitely to get many more leftover nodes if you can trigger the unmount/destroy before the transition finishes.

@stale
Copy link

stale bot commented Nov 28, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale-bot label Nov 28, 2021
@stale
Copy link

stale bot commented Dec 12, 2021

This issue has been closed as it was previously marked as stale and saw no subsequent activity.

@stale stale bot closed this as completed Dec 12, 2021
@csangonzo
Copy link
Author

.

kiosion added a commit to kiosion/kio.dev that referenced this issue Dec 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants