react-tap-event-plugin icon indicating copy to clipboard operation
react-tap-event-plugin copied to clipboard

IE8 onTouchTap not firing (React v 0.13.2)

Open codeuniquely opened this issue 9 years ago • 0 comments

I have a React Component to display some text in a DIV and trap the click / tap / touch.

var React = require('react');
var Tab = React.createClass({

  handleTouchTap: function(){
    alert('handleTouchTap');
  },
  render: function(){
    // THIS FAILS: <div className="tab" onTouchTap={this.handleTouchTap}>
    return (
    <div className="tab"  onClick={this.handleTouchTap}>
      Click Me !!!
    </div>
    )
  }
});
module.exports = Tab;

When I use 'onTouchTap' (commented out above) and click on the DIV nothing happens, the event seems not to fire and the alert never appears. But, if I swap out the onTouchTab and use a standard onClick (as shown above) then the event fires and the alert appears.

I've initialized the Plugin => my App.JSX has this at the start

/* App.react.js */
var React = require('react');
var injectTapEventPlugin = require("react-tap-event-plugin");

// Make sure React can deal with Touch Events.
React.initializeTouchEvents(true)

// Inject touch / tap handling for all components
injectTapEventPlugin();

Interestingly the event does fire if I'm using Chrome, FireFox, Safari, and IE9+)

All the requested Shims and Shame for IE8 are loaded and no Exceptions or Errors fire when using the app, other (Display components work - just nothing that requires a click works)

codeuniquely avatar Apr 26 '15 09:04 codeuniquely