Skip to content

event.stopPropagation()

event.stopPropagation — Events > Event object > Propagation and browser defaults. Cytoscape.js signatures, parameters and return contract.

event.stopPropagation — Events › Event object › Propagation and browser defaults

Preview · Events › Event object › Propagation and browser defaults

Read in the complete API reference · All API members

// Stop the event bubbling to further phases: the remaining ancestors and the core do not see it
event.stopPropagation(): void

Stop the event bubbling to further phases: the remaining ancestors and the core do not see it. Returning false from a handler does the same. With originalEvent attached this also calls the DOM event's stopPropagation(), so an outer DOM listener stops seeing it too.

Returns void

Example

event.stopPropagation();
console.log(event.isPropagationStopped()); // true

Example graph and handle setup