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

Loss of styles on exit transition when used with @suid #43

Open
nate-summercook opened this issue Feb 1, 2024 · 1 comment
Open

Loss of styles on exit transition when used with @suid #43

nate-summercook opened this issue Feb 1, 2024 · 1 comment

Comments

@nate-summercook
Copy link

When this library is being used together with https://suid.io/, all material styles are lost on exit transition, because the <style> element in the <head> gets removed when the exit transition starts. Seems like SUID is cleaning house when it thinks the styled element is no longer in the dom (while it still is because of the ongoing transition).

Here's an example snippet. The described behavior happens when removing a message, which triggers the exit animation:

    <TransitionGroup name="slide-fade">
      <For each={messages()}>
        {(message) =>
          <Paper onClick={() => messageClicked(message)}>
            <Typography>{message.text}</Typography>
          </Paper>
        }
      </For>
    </TransitionGroup>
@thetarnav
Copy link
Member

thetarnav commented Feb 2, 2024

Should this be an issue here or in SUID?
I’m not sure what can be done here. Transition component doesn’t have a control over the disposal of the owner of existing branch, it only reacts to it.
I’m not sure what SUID could do either. If they remove the styles in a cleanup, they don’t have other options.
Both SUID and transition-group are separate libraries, and neither should special case one another.
The only common part between the two is solid, so this is where the solution needs to be introduced imo.
At least if the API of transition-group is to remain without change. Which is, I think, one of the goals of this library.

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