79369406

Date: 2025-01-19 17:23:16
Score: 1
Natty:
Report link

you can wrap your stopPropagation in a function. then add/remove.

function stopProp(event){
    event.stopPropagation(); // or stopImmediatePropagation();
}
yourTarget.addEventListener("click", stopProp);
yourTarget.removeEventListener("click", stopProp);
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Youssef