Skip to content

Modal backdrop covering the modal container #41410

Answered by patkon
razorkyle asked this question in Q&A
Discussion options

You must be logged in to vote

You've actually already given yourself the answer to your question:

This issue persist when modal container is put inside fixed position container like below code

This behavior is also described in the documentation. How it works, point 4.

Modals use position: fixed, which can sometimes be a bit particular about its rendering. Whenever possible, place your modal HTML in a top-level position to avoid potential interference from other elements. You’ll likely run into issues when nesting a .modal within another fixed element.

I always do it like this:

Place the <button type="button" class="btn btn-primary" data-bs-toggle="modal" ... wherever you want but the <div class="modal fade" ... a…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by julien-deramond
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #41409 on April 25, 2025 06:28.