Modal closes always on ok button
See original GitHub issueI have a modal and I have everything working except that when I click on the OK button the modal dissapears. I want to keep the modal open if there are errors in the supplied data.
My modal looks like this:
<b-modal id="editModal" :title="editModalTitle" @ok="saveData" @close="clearData" hide-header-close>
I have tried returning false in saveData(e) { return false; } however that doesn’t work
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Warning on modal close - Stack Overflow
Add class closefirstmodal in Form Modal Header / Footer Close button to invoke the warning modal with jQuery click function and bootstrap modal...
Read more >Modal | Components - BootstrapVue
In this case use the hide event to control cancelling of the modal close. Event hide is always emitted, even if ok ,...
Read more >Solved: Modal windows - the "OK" button - JMP User Community
The OK button or its "equivalent" is required in a modal window. The point is to construct your modal window so that the...
Read more >modal windows - Are "close" and "x" on a popup redundant?
Yes: Don't place a X button nor a Close button, because you don't want to give the user the easiest and fastest way...
Read more >How to change the position of modal close button in bootstrap?
× gives the cross icon. · data-dismiss switches the display property of modal element from “block” to “none”. · You can shift this...
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
Check out the docs on the
modal
component under Prevent Closing: https://bootstrap-vue.js.org/docs/components/modal#prevent-closingYou should be able to call
e.cancel()
in the@ok
handler. Keep in mind that this is done synchronously, so any async stuff will require cancelling synchronously, and then manually closing in the async callback logic.@chamra Try with the following: