stopPropagation() with tap event

后端 未结 5 1871
[愿得一人]
[愿得一人] 2021-02-15 02:12

I\'m using hammer.js and it appears that I event.stopPropagation() doesn\'t work with tap event.

If I click on the child, the associated event is triggered

5条回答
  •  故里飘歌
    2021-02-15 02:57

    You could try checking e.currentTarget (or is it e.target?) inside the parent handler to find out which element was tapped; if it's the child element then just return immediately, else continue with the function.

提交回复
热议问题