Skip to content

AJAX loaded modal not being removed from DOM on close #301

@vanboom

Description

@vanboom

When modals are opened using <a rel='modal:open'...>, they are removed from the DOM when the modal is closed. This does not happen is the modal is loaded via AJAX per the examples here.

// Open modal in AJAX callback
$('#manual-ajax').click(function(event) {
  event.preventDefault();
  this.blur(); // Manually remove focus from clicked link.
  $.get(this.href, function(html) {
    $(html).appendTo('body').modal();
  });
});

Please consider removing the modal from the DOM when it is closed the same way that it is removed when launched from a hyperlink.

I have fixed this and tested - will submit a PR, but not sure if this project still has active maintainers?

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