Bootstrap 5 modal {show: true} fail?
Created by: mjau-mjau
Unless I have misunderstood, shouldn't a modal show immediately when instantiated from JS?
var myModal = new bootstrap.Modal(document.getElementById('myModal'), {show: true});
According the docs, {show: true}
is default anyway.
https://v5.getbootstrap.com/docs/5.0/components/modal/
Yet the modal does not show unless one triggers myModal.show()
:
var myModal = new bootstrap.Modal(document.getElementById('exampleModal'), {show:true});
myModal.show(); // <- required