React. preventDefault() for onCopy event does not work

前端 未结 3 1512
青春惊慌失措
青春惊慌失措 2021-02-13 21:21

I\'m trying to figure out how to make the clipboard events return false on the onCopy event. I use for test the onCopy handler and e.preventDefau

3条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-13 22:07

    This should be a comment but I don't have enough reputation. I think e.preventDefault() is enough for (at least) React 16.

    Working example on Codesandbox

提交回复
热议问题