2

Is there a way to register a low-level js event that could never be stopped from bubbling?

I'm constructing a base-class that should always receive onclick event. The problem is that child class could use e.stopPropagating() which effectively cuts my base onclick behavior.

Is there a way to be able to receive onclick event in base-class independently of what people can (over)write in child class?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
31415926
  • 3,811
  • 7
  • 47
  • 78
  • Behaviour you described violates event driven model. If such behaviour could exists you simply can't expect anything from your application to be 100% true if you using listeners. – Eraden Jan 25 '15 at 14:55
  • Only way you can do something like that is by assigning listener before child got `stopPropagation` listener. This is really hard to implement and not always possible. – Eraden Jan 25 '15 at 15:02
  • 1
    Possible duplicate of [Real world example where event capturing is necessary / preferred?](https://stackoverflow.com/questions/24786769/real-world-example-where-event-capturing-is-necessary-preferred) – Paul Sweatte Sep 18 '17 at 17:25

0 Answers0