Skip to content
This repository was archived by the owner on Dec 13, 2023. It is now read-only.
This repository was archived by the owner on Dec 13, 2023. It is now read-only.

Only listen to target element CSS events. #1

@minht11

Description

@minht11

Imagine you have a button which toggles transition on click, something like this:

<Transition>
  <div id='animated-container'> // This has animation of 300ms
      <button /> // This button has background transition of 100ms on hover
    </div>
<Transition>

Since button transition finishes first these listeners inside cssExit will catch it and remove element from DOM despite the fact that main animation is still running.

solid-flip/src/helpers.ts

Lines 199 to 200 in 4361a60

el.addEventListener('transitionend', removeEls, { once: true });
el.addEventListener('animationend', removeEls, { once: true });

A solution for that is to check if event target is the container and not one of the children.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions