0
votes

I'm attempting to use https://github.com/zilverline/react-tap-event-plugin for eliminating the 300ms delay on iphone tap events, but upon clicking my element with a mouse, the event is firing twice. Here's my code:

In my main app.js file:

import injectTapEventPlugin from 'react-tap-event-plugin';
injectTapEventPlugin({
    ignoreMouseThreshhold: 1000 //I've tried with and without this
});

In my component:

<th
    onTouchTap={ this.handleTap.bind(this); }
    onClick={ this.handleTap.bind(this); }>

The handleTap method is firing twice when clicking the element from a computer mouse.

Edit: After inspecting the events, it appears that a "mouseup" event is fired, directly followed by a "click" event.

1
Which version of react are you using?Aaron Franco
0.14.7 -- It seems to work if I remove the click handler altogetherThinkingInBits

1 Answers

0
votes

If you are using onTouchTap do not use onClick.