bootstrap.native: Opening a modal after another modal doesn't always show backdrop

I’ve discovered one issue when opening a modal after another. I have is that sometimes the backdrop doesn’t get properly the show class. It happens a bit randomly, so i guess it’s due to the transition from the previous modal that sometimes overlaps the transition of the new modal.

From what I can see, sometimes getCurrentOpen(element) returns the new modal as expected, but sometimes not, and therefore hides the backdrop even if there is a new modal being shown.

Actually, this is even more obvious if you do a setTimeout, then it almost always happen

modal.addEventListener("hidden.bs.modal", () => {
  setTimeout(() => {
    // open modal here
  }, 10)
});

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 18 (18 by maintainers)

Most upvoted comments

@thednp yes works fine on master indeed!