I was creating a form in a Bootstrap Modal to allow users to create new posts from the frontend. Everything seemed alright until I wanted to upload a file to the media library or choose one already uploaded:
This opens another modal using JS from the WordPress core. Unfortunately both BS and WP modals are using the same class on the body tag to indicate an opened modal: modal-open
. When closing the secondly opened (WP) modal, this class is removed from the body which results to unwanted behaviour. You can scroll the document in the background but not the modal itself.
How could one fix this conflict?