Click event firing after dragging

后端 未结 2 1796
再見小時候
再見小時候 2021-01-24 05:21

Hey I\'m using Angular material Drag and drop. Everything is working fine but after each drag it triggers the click event and it\'s really annoying. How can I stop this?

2条回答
  •  走了就别回头了
    2021-01-24 05:46

    Turning off pointer events for the element while it's being dragged prevents a click event afterwards:

    template:

    styles.scss:

    .pointer-events-none {
      pointer-events: none;
    }
    

提交回复
热议问题