Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

click vs. singleTap

What's the difference?

— asked August 15th 2010 by Sindre Sorhus
  • click
  • difference
  • event
  • events
  • singletap

2 Answers

  • Accepted Answer

    Straight from the docs:
    click fired when the device detects a click (longer than touch) against the view

    — answered August 18th 2010 by Richard Venneman
    • I know the Docs say that, but in my experience click is the exact same as SingleTap. Maybe there is a slight second difference between the taps, but it seems they do pretty much the exact same thing (Both get fired when you touch the screen)

      — commented August 19th 2010 by Colton Arabsky
    • Thank you, I've just manage the multiple touch with this subtlety. (longer than click)

      — commented October 22nd 2012 by Robin D. (Perspecteev)
  • If you are making an app for mobile, never use click, use singletap.

    The reason being that if you want to bind a click and a dblclick on the same view, the app won't make the difference between two single clicks and a dblclick. so:

    • touching the screen twice will result in launching once the function bound to click and launching once the function bound to dblclick)

    On the other hand, and as things should be done, if you listen to singletap and doubletap on the same view:

    • touching the view once will launch the function bound to the singletap event.
    • touching the view twice will launch the function bound to the doubletap event

    remember: don't listen to 'click type' event in your mobile app, this will avoid you some problem

    — answered February 8th 2013 by Kevin Purnelle
    1 Comment
    • Thanks this was very helpful for me! :D

      — commented May 13th 2014 by Jason van der Zeeuw
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.