How to stop event propagation when using delegate?

后端 未结 6 509
日久生厌
日久生厌 2021-01-18 05:12

When I use .bind to bind event on child and parent, child event can stop event propogation with return false; But when I use delegate, return false; does not stop event prop

6条回答
  •  鱼传尺愫
    2021-01-18 05:39

    You should be using e.stopPropagation() to prevent the propagation, not by returning false.

    return false is technically two things; 1) prevent the default action, and 2) stop propagation. Try switching to the method invocation on e and see if that fixes your problem.

提交回复
热议问题