modal event.cancel() in catch doesn't work
See original GitHub issueSo I have a try/catch and when I do event.cancel()
on the catch, it is ignored.
async submit (event) {
try {
await this.$validator.validateAll();
} catch (error) {
console.log(error);
console.log(event);
return event.cancel();
}
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Capture close event on Bootstrap Modal - Stack Overflow
Show activity on this post. I have a Bootstrap Modal to select events. If the user clicks on the X button or outside...
Read more >JavaScript - Bootstrap
Multiple open modals not supported. Be sure not to open a modal while another is still visible. Showing more than one modal at...
Read more >Modal | Components - BootstrapVue
preventDefault() method of the event object passed to your ok (OK button), cancel (Cancel button), close (modal header close button) and hide event...
Read more >Window: beforeunload event - Web APIs | MDN
According to the specification, to show the confirmation dialog an event handler should call preventDefault() on the event. The HTML ...
Read more >Modal - Ant Design
Modal.destroyAll() will destroy all confirmation modal dialogs. Usually, you can use it in router change event to destroy confirm modal dialog automatically.
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
Which event are you binding to?
Modal’s
event.cancel()
will only work with@ok=
,@cancel=
and@hide=
. bindings.Awesome! I’m going to close this and open a docs issue to explain using cancel in async flow. I think it’s in the lib’s best interest to leave that logic to the integrator rather than forward the extra code size to everyone.