While working with Angular 6 + Bootstrap 4 combination I stumbled upon the issue with modal. Whenever I open a modal - it opens up behind the modal-backdrop. Interesting that it is not the only modal on the project, but only this one acts funny.
I have imported relevant libraries as follows (Angular.json file):
"styles": [
"src/styles.scss",
"node_modules/bootstrap/dist/css/bootstrap.min.css"
],
"scripts": [
"node_modules/jquery/dist/jquery.min.js",
"node_modules/popper.js/dist/umd/popper.min.js",
"node_modules/bootstrap/dist/js/bootstrap.min.js"
]
Button to open modal:
<div class="row">
<div class="col">
<button class="btn btn-md" data-toggle="modal" data-target="#modalID">Click Here</button>
</div>
</div>
Modal itself (simplified):
<div class="modal fade" id="modalID">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<!-- Header Here -->
</div>
<div class="modal-body">
<!-- Body here -->
<div class="modal-footer">
<div class="col-6">
<!-- Buttons here -->
</div>
</div>
</div>
</div>
Now all of the HTML code is inside a child component - which is a part of a parent. Code below:
<div class="row">
<div class="col-lg-9">
<div class="space-bottom">
<app-given-component></app-given-component>
</div>
</div>
</div>
I personally believe that the issue the modal is behind the backdrop is due to styling on row class. Using dev tools I remove the display:flex; and modal appears to be OK, but the rest of the styling on the page becomes messed up. I don't know how to overcome this.
Additional note: it is not an option to remove row or col-lg-9 classes.
I would really appreciate your help.
Many thanks, Alex