Skip to content

Modal backdrop does not disappear, when modal-dialog being removed in HTML #16320

@SilverFire

Description

@SilverFire

Use case: I use modal for actions' confirmation.
The modal block is placed inside of a Pjax wrapper.
There OK button triggers a Pjax request, which (in case of success) replaces overall Pjax block with the new content.
When the modal block is being removed, the backdrop stays alive, because it is placed in the end of the body.

Expected behavior: the backdrop will be removed automatically, when the modal wrapper disappears.

Steps to reproduce:

  • Open Modal Live Demo, click the "Launch demo modal" button
  • Open the development console and remove corresponding modal wrapper. Just execute:
$('#myModal').remove()
  • Meditate on the stuck backdrop 😉

Guys, is it possible to fix this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions