react-mobile-picker
react-mobile-picker copied to clipboard
fix touchmove event.preventDefault();
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
en
@liyatang 抱歉回复晚了,你的提交中需要有以下两个修改:
- 你可以用
ref.current
来获取 dom 而不需要使用 react-dom 的findDOMNode
方法,参考 https://reactjs.org/docs/refs-and-the-dom.html - 在绑定
touchmove
事件时,需要显示地设置passsive
为false
,参考 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 后重新提交一个版本,谢谢。
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.