【发布时间】:2016-03-29 22:41:56
【问题描述】:
我正在尝试使用https://github.com/zilverline/react-tap-event-plugin 来消除 iphone 点击事件的 300 毫秒延迟,但是在用鼠标单击我的元素时,该事件会触发两次。这是我的代码:
在我的主 app.js 文件中:
import injectTapEventPlugin from 'react-tap-event-plugin';
injectTapEventPlugin({
ignoreMouseThreshhold: 1000 //I've tried with and without this
});
在我的组件中:
<th
onTouchTap={ this.handleTap.bind(this); }
onClick={ this.handleTap.bind(this); }>
从计算机鼠标单击元素时,handleTap 方法会触发两次。
编辑:检查事件后,似乎触发了“mouseup”事件,紧接着是“click”事件。
【问题讨论】:
-
你使用的是哪个版本的 react?
-
0.14.7 -- 如果我完全删除点击处理程序似乎可以工作
标签: javascript ios events reactjs