Skip to content

Dialog Element Closing on Morph #111

@jameskerr

Description

@jameskerr

I'm thrilled this library exists. Hot-reloading rails apps has been a headache, and it seems like all the pieces are here for a great experience.

I have this little bit of code in my app to tell turbo to leave the dialog element's attributes alone, so that I can close it with an animation.

document.on("turbo:before-morph-attribute", (e) => {
  if (e.target instanceof HTMLDialogElement) {
    e.preventDefault();
  }
});

With spark, this didn't work. Spark uses the idomorph library directly. It appears there is no way to setup a callback like the one above.

Would you like me to try and add this? If so, give me a rough design for how you'd do it. A "prompt" if you will. 😆

Thanks again,
James

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