B5 - modal not open on $('#myModal').show();
See original GitHub issueI have been able to verify that, if there is no other problem, by calling the function $ ('# myModal').show();
it does not show the modal, and one of the things that happens is that it does not add the class “show” so it stays in opacity 0.
I could not check if something similar happens in “hide”.
Thanks.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Bootstrap V5 manually call a modal myModal.show() not ...
Bootstrap V5 manually call a modal myModal.show() not working (vanilla javascript) · 1. It looks like you don't have jquery - show() is...
Read more >Modal · Bootstrap v5.0
If the height of a modal changes while it is open, you should call myModal.handleUpdate() to readjust the modal's position in case a...
Read more >Bootstrap 5 Modal - W3Schools
The following example shows how to create a basic modal: ... class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#myModal"> Open modal </button>
Read more >Bootstrap 5 Modal myModal.show() not working JavaScript ...
Bootstrap 5 Modal myModal. show() not working JavaScript (SOLVED) ; Professional CSS Course: https://bytegrad.com/professional-css... ;
Read more >How to Use Bootstrap Modals Without jQuery
However, it's not too difficult to work around - in fact, it requires less ... classList.add("show") } function closeModal() { document.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Was
$('#myModal').show()
ever supported? As far as I know official way to open a modal was$('#myModal').modal('show')
. Since Bootstrap v5 is not using jQuery you have to use.show()
method of theModal
object. But I’m not an expert.You are right on this
not using jQuery (by default), but can yet used like you proposed too 😉
In general, the Bootstrap components can be used with the following ways