Modal not usable without JavaScript. No Fallback
See original GitHub issueA modal is hidden by default, which makes it not usable if one wants to statically show a modal dialog for a user, which might not have JavaScript enabled.
As you can see in this JSBin example one can use d-block
or style="display:block"
to force showing the modal and also manually add the backdrop to the html without JavaScript, but the resulting modal is not “JavaScript-enabled”. It is not possible to dismiss it by clicking the X or the backdrop.
So at the moment, when showing a Modal to non-JavaScript users the modal has reduced functunality for users with Javacript (In comparison to what would be “possible” for these users). But to add the missing functionality one has to hide the modal for non-JavaScript users which is not an option, because they need to be able to see/use it as well.
I would prefer if users with JavaScript would have access to the full functionality without completely removing the functionality for non-JavaScript users.
EDIT: This issue is kind of related to #24939. If the Javascript code would have an option to read an already shown modal from the DOM both issues could be fixed.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:20 (9 by maintainers)
<a data-toggle="modal" data-target="#myModal" href="some url explaining it's 2018">No JS fallback</a>
If you want the modal open on page load add
style="display:block;"
to the modaladd
<div class="modal-backdrop show"></div>
at the end of the page if you want the backdropadd
class="modal-open"
to your<body>
tag if you don’t want the page to scroll