tbranyen / diffhtml-inline-transitions

Inline transition hooks directly into tagged templates

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Current method will leak handlers.

gnarf opened this issue · comments

If an element is replaced or removed, it's handlers will still be added to the transition states.

We may want to make a single handler for each event type that walks elements/their parents(if these events bubble) to determine if they have relevant events they want fired, rather than attaching each event as it's own transition state handler.

Good catch, I was thinking for some reason that diffHTML already unregistered transition hooks when elements were removed, but after looking again realized that doesn't make sense. Transition states aren't tied to any specific element, so we need to listen to the replaced and detached hooks in this lib as well to properly unbind them.

Patch here: #2

Resolved in 02d0892