What is the purpose of "$event.stopPropagation()"?

GLewis5
Tera Guru
 
1 ACCEPTED SOLUTION

Robbie
Kilo Patron
Kilo Patron

Hi @GLewis5,

 

Have you checked out the SN Docs site?

https://developer.servicenow.com/dev.do#!/reference/next-experience/washingtondc/ui-framework/main-c...

 

"An action can be prevented from propagating further by calling action.stopPropagation() in an effect function or by setting stopPropagation: true in the actionHandler config. This prevents any ancestor components from being able to handle the same action.

Note: If you want to stop the propagation of an action that is originally dispatched by the same component, you must use the stopPropgation: true configuration of the action handler. The dynamic action.stopPropagation() call in an effect function will not work in this case. This is because an action handler for the originating component is called after the action has finished propagating."

 

To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Kudos.


Thanks, Robbie

View solution in original post

2 REPLIES 2

Robbie
Kilo Patron
Kilo Patron

Hi @GLewis5,

 

Have you checked out the SN Docs site?

https://developer.servicenow.com/dev.do#!/reference/next-experience/washingtondc/ui-framework/main-c...

 

"An action can be prevented from propagating further by calling action.stopPropagation() in an effect function or by setting stopPropagation: true in the actionHandler config. This prevents any ancestor components from being able to handle the same action.

Note: If you want to stop the propagation of an action that is originally dispatched by the same component, you must use the stopPropgation: true configuration of the action handler. The dynamic action.stopPropagation() call in an effect function will not work in this case. This is because an action handler for the originating component is called after the action has finished propagating."

 

To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Kudos.


Thanks, Robbie