2

Stage have both click and contentClick and others, I check the doc and no place to explain their differences.

contentClick just a alias or have some particular function?

navono
  • 152
  • 1
  • 8

1 Answers1

3

All content[Something] events are out of internal hit detection flow and out of event bubbling flow.

When you listen to contentClick event you can't know what shape is clicked, because e.target is undefined.

Historic note:

Some time ago click event was not triggering when you click on empty space of the stage. So that is the case where contentClick event was useful. But that behavior is fixed.

lavrton
  • 18,973
  • 4
  • 30
  • 63
  • Thanks for your explanation. – navono May 31 '18 at 09:49
  • 1
    I have another question about the parameter: event. It's method seems don't match the standard [Event](https://developer.mozilla.org/en-US/docs/Web/API/Event/stopPropagation), when I call `stopPropagation` on it caused an error. – navono May 31 '18 at 10:18
  • 1
    Because it is not a standard event. Standart event is saved inside "evt" property. – lavrton May 31 '18 at 15:15