My web app has a bootstrap modal that seems to have a mind of its own. Even when I use myModal.modal('close');
, the modal stubbornly stays displayed. It's a strange problem that's really frustrating.
Every so often, about one out of ten times, the display: block;
property lingers even after I close the modal. While the modal itself is hidden, it still covers my entire page and prevents me from clicking on anything.
I attempted to resolve this issue by adding:
$('#myModal').on('hidden.bs.modal', function () {
$(this).css('display', 'none !important');
})
Unfortunately, this solution did not work, as the modal div continues to have style="display: block;"