Skip to content

Trigger turbo:before-morph-added and turbo:before-morph-remove events #1477

@ajoabraham

Description

@ajoabraham

It would be great if we can hook into node add and node remove events to apply custom animations or other processing. Currently we can only hook into before-morph-element or before-morph-attribute. These will not give us access to newly added nodes for custom processing.

Current default Idiomorph callback for beforeAdded:

beforeNodeAdded = (node) => {
return !(node.id && node.hasAttribute("data-turbo-permanent") && document.getElementById(node.id))
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions