After update to 8.x-3.15 (after reading release noted, I suspect the issue occurs at the 8.x-3.14 release)
When using native Bootstrap modals within the TWIG page.html.twig markup, modals no longer are able to be triggered via Bootstrap's Javascript modal('show') method for users that are logged in with the Drupal admin toolbar present. They are however able to be triggered via a link with the "data-toggle="modal" data-target="#modal"" method.
I have found that if I disable the option for "Enable Bootstrap Modals" under my less Bootstrap subtheme, the modal('show') method works again.
To replicate, add a modal to the page:
<div id="modal-search" class="modal fade modal-fullscreen" tabindex="-1" role="dialog" aria-label="Search">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-body">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">x</button>
Modal content here...
</div>
</div>
</div>
</div>
And attempt to trigger via Javascript (while logged in as a user with access to the admin toolbar):
jQuery(window).on("load", function() {
jQuery("#modal-search").modal('show');
})
My testing indicates that:
- Modals are able to be triggered via modal('show') for anonymous users, or users that are authenticated without admin toolbar
- Modals are able to be triggered via modal('show') when Enable Bootstrap Modals option is disabled in sub-theme settings
Comment | File | Size | Author |
---|---|---|---|
#2 | 3016697-2.patch | 1.32 KB | markhalliwell |
Comments
Comment #2
markhalliwellComment #4
nrusse02 CreditAttribution: nrusse02 commentedThank you, Mark!