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

!!$store.property problem with transitions not being removed #4620

Closed
Fygo opened this issue Apr 1, 2020 · 2 comments · Fixed by #4634
Closed

!!$store.property problem with transitions not being removed #4620

Fygo opened this issue Apr 1, 2020 · 2 comments · Fixed by #4634

Comments

@Fygo
Copy link

Fygo commented Apr 1, 2020

This took me a while to reproduce and I am not quite sure where the real issue lies but please, take a look.

REPL: https://svelte.dev/repl/b98c363f09c54264b0484a7c51f5f4e2?version=3.20.1

Description:
The important stuff is in the ListWindow.svelte. This window should serve to modify or create new lists in my app, that's why there is an "isEditing" variable defined (if not editing -> new list). This variable gets its value from the global store. That works flawlessly.
There are two transitions in this component, one on the "window div" element (first child node of the (section.form-section) which animates the window popup and the other one on the warning paragraph text which is shown only when the input field has been left empty and the "Add" button clicked.

When I use !!$globalStore.editedList assigning it to the isEditing var, it breaks the animation of the "window div" WHEN/IF the warning paragraph is visible. It doesn't remove the animation from the "window div".

Steps to reproduce:

  1. Click the Open button
  2. Click the Add button of the newly created "window" without typing into the input -> red <p> should appear
  3. Click the Cancel button of the window -> window animates out but it is not removed from the DOM after the animation has completed.

Expected result:
Window is removed from the DOM

Every other scenario works fine:

  • Typing text, clicking Add -> OK
  • Typing text, clicking Cancel -> OK
  • Empty input, clicking Cancel -> OK
  • changing !!$globalStore.editedList to false also solves the problem!

Workaround:
Setting |local remedies this in my example.

If this is some logical problem on my side, advices would be appreciated! Thanks a lot.

@antony
Copy link
Member

antony commented Apr 9, 2020

Closing in favour of the many other issues documenting this bug. Hopefully we can get the PR by @pushkine merged soon :)

@antony antony closed this as completed Apr 9, 2020
@Conduitry
Copy link
Member

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

Successfully merging a pull request may close this issue.

3 participants