modal('show') after a modal('hide') doesn't work
See original GitHub issueimmediately after hiding a modal, if a show call is issued it doesn’t work e.g.
$('#show_modal').click(function(){
$('#test-modal').modal('show')
$('#test-modal').modal('hide')
$('#test-modal').modal('show')
})
Looks like end effect should be a modal dialog shown, but instead modal is hidden with a black screen see it in action here http://jsfiddle.net/anuraguniyal/qzAmP/
For time being I am working around it by issuing a setTimeout of 1000 msec, because looks like bootstrap takes 500 msec to hide modal in a timeout
Issue Analytics
- State:
- Created 11 years ago
- Comments:20 (1 by maintainers)
Top Results From Across the Web
Bootstrap modal hide is not working - Stack Overflow
So your click is firing the modal show as your data attributes set, and your Javascript does not affect this trigger.
Read more >modal.show not working - MSDN
Hi I'm using bootstrap modal dialog. If I use like this. <a class="last" href="#login-modal" data-toggle="modal"> ...
Read more >Bootstrap 5 Modal Show, Close, Hide & Toggle - free examples
Modal Backdrop ; hide, Manually hides a modal. Returns to the caller before the modal has actually been hidden (i.e. before the hidden.mdb.modal...
Read more >Modal - Bootstrap
How it works · Modals are built with HTML, CSS, and JavaScript. · Clicking on the modal “backdrop” will automatically close the modal....
Read more >Modal Events - hide.bs.modal - W3Schools Tryit Editor
The hide.bs.modal event occurs modal is about to be hidden. Click the "Hide Modal" button to trigger the hide method (which will trigger...
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
Have you tried using
Hi, I have tried this as follows.
$(“.btn-plus”).click(function(){ $(‘#new_passenger’).modal(“show”).on(‘hide’, function() { $(‘#new_passenger’).modal(‘hide’) }); });
I worked. sorry for my english… =)