Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link a modal backdrop to its open Modal #41138

Open
2 tasks done
endlacer opened this issue Jan 7, 2025 · 0 comments
Open
2 tasks done

Link a modal backdrop to its open Modal #41138

endlacer opened this issue Jan 7, 2025 · 0 comments
Labels

Comments

@endlacer
Copy link

endlacer commented Jan 7, 2025

Prerequisites

Proposal

Link a modal backdrop to its opeen modal by data-attribute.

So instead of

<div class="modal fade show" id="staticBackdropLive" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLiveLabel" aria-modal="true" role="dialog" style="display: block;">
...
</div>

<div class="modal-backdrop fade show"></div>

i would propose adding the id of the modal as a data-attribute in the backdrop:

<div class="modal fade show" id="staticBackdropLive" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLiveLabel" aria-modal="true" role="dialog" style="display: block;">
...
</div>

<div class="modal-backdrop fade show" data-id="staticBackdropLive"></div>

Motivation and context

When working with mutliple modals on top of each other, you would be able to determine, which backdrop belongs to which modal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant