cancelable option
An event option saying listeners may call preventDefault to cancel the action the event announces.
In more detail
When a component dispatches a cancelable event before acting, dispatchEvent returns false if any listener vetoed it, so the component can stop. This is a simple confirmation hook between components.
Related terms
- preventDefault — A method on an event that cancels the browser's built-in action, such as submitting a form or following a link.
- dispatchEvent() — The method that sends an event object to a target so its listeners run, synchronously, before the call returns.
- CustomEvent — A browser event type you create and name yourself, which carries any data you like in its detail property.
Taught in
- CustomEvent Dispatching And Decoupled Component Event Buses — Frontend Architecture & Web Platform