Do I still need then to duplicate my handler inside onTouchEnd attribute?

On 02/09/2015 07:55 PM, Khalid Jebbari wrote:
No need to fiddle with other libs or complicated build steps, React js handle 
this very well.

Simply handle the touchend event and preventDefault().

In React's JSX syntax :

<div onClick={myHandler} onTouchEnd={myHandler}>...</div>

myHandler: function(event) {
     event.preventDefault();
     ... // do your stuff
}

The preventDefault() call avoids the click to trigger 300ms after the touch 
event.


--
Note that posts from new members are moderated - please be patient with your 
first post.
--- You received this message because you are subscribed to the Google Groups "ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/clojurescript.

Reply via email to