#94219current modal state handling is bogus
Description
Our modal implementation has an internal state handling to determine which modal is the current one if multiple modals get rendered. The new “current” modal is determined once a previous modal is closed, this happens on the hidden.bs.modal event. However, this will break the next modal in case modal A gets closed and triggers modal B:
- if modal A is visible, the stack contains 1 item
- if modal A gets removed, the stack still contains 1 item as long the modal is not completely destroyed
- while modal A gets removed, modal B is rendered, which lets the stack contain 2 items now
- once modal A is removed, the last item is removed from the stack, which represents modal B