react-mobile-picker icon indicating copy to clipboard operation
react-mobile-picker copied to clipboard

fix touchmove event.preventDefault();

Open liyatang opened this issue 5 years ago • 3 comments

liyatang avatar Nov 01 '18 15:11 liyatang

http://w3cay.com/post/dc49b55.html?title=React%E7%A6%81%E6%AD%A2%E9%A1%B5%E9%9D%A2%E6%BB%9A%E5%8A%A8%E8%B8%A9%E5%9D%91%E5%AE%9E%E8%B7%B5%E4%B8%8E%E6%96%B9%E6%A1%88%E6%A2%B3%E7%90%86&from=sg-an

了解了一下原因,主要是 Chrome 中会默认把 passive 设置为 true,需要在绑定的时候手动设置一下 passive

adcentury avatar Nov 05 '18 10:11 adcentury

en

liyatang avatar Nov 08 '18 07:11 liyatang

@liyatang 抱歉回复晚了,你的提交中需要有以下两个修改:

  1. 你可以用 ref.current 来获取 dom 而不需要使用 react-dom 的 findDOMNode 方法,参考 https://reactjs.org/docs/refs-and-the-dom.html
  2. 在绑定 touchmove 事件时,需要显示地设置 passsivefalse,参考 https://w3cay.com//post/dc49b55.html?title=React%E7%A6%81%E6%AD%A2%E9%A1%B5%E9%9D%A2%E6%BB%9A%E5%8A%A8%E8%B8%A9%E5%9D%91%E5%AE%9E%E8%B7%B5%E4%B8%8E%E6%96%B9%E6%A1%88%E6%A2%B3%E7%90%86&from=sg-an

修改完后我会进行合并和发布,如果你没有时间和精力来修改,也可以告诉我,我会关闭这个 PR 后重新提交一个版本,谢谢。

adcentury avatar Dec 29 '20 04:12 adcentury

I will close this PR since there aren't new commits from my last comment. If you have any recent changes, feel free to create a new Pull Request.

adcentury avatar Nov 08 '22 06:11 adcentury