question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

modal event.cancel() in catch doesn't work

See original GitHub issue

So 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:closed
  • Created 6 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
tmorehousecommented, Jun 30, 2017

Which event are you binding to?

Modal’s event.cancel() will only work with @ok=, @cancel= and @hide=. bindings.

0reactions
alexsasharegancommented, Jun 30, 2017

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found