Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-9376

iOS: 'click' event fires on a view upon finger-down instead of finger-up

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Cannot Reproduce
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: iOS
    • Environment:
      • Titanium SDK 2.1.0.v20120523205530 (and all the way back to 1.8.2 at least)
      • Titanium Studio 1.0.9.201202141208
      • iOS 5.0 (simulator)
      • Mac OSX 10.7.2

      Description

      Problem

      The 'click' event of a view fires when the view is touched, even before the finger (or mouse) is released.

      A true 'click' does not (should not) exist until the component receives a mouse-down followed by a mouse-up without the mouse moving in between. The iOS implementation is not adhering to this definition.

      Expected behavior

      When you touch and hold your finger (or mouse) down on a view, only the touchstart, longpress, and longclick (Android only) events should fire. The click event should not fire until the finger (or mouse) is lifted, and then only if the finger (or mouse) has not moved since the touch started.

      Actual behavior

      When you touch and hold your finger (or mouse) down on a view on the iPhone simulator, the click event fires.

      Works on Android correctly.
      Broken on iOS.

      Therefore, this is also a parity issue.

      Testcase

      app.js:

      win1=Ti.UI.createWindow({havbarHidden:false,
                               layout:'vertical',
                               backgroundColor:'gray'});
      vw1=Ti.UI.createView({height:80,
                            left:30,
                            right:30,
                            backgroundColor:'blue'
                           });
      win1.add(vw1);
      lbl1=Ti.UI.createLabel({text:'Press and hold the blue box above',
                              color:'white'});
      win1.add(lbl1);
       
      function DoClick()
      {
        alert('View got clicked');
      }
      vw1.addEventListener('click',DoClick);
      win1.open();
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                emerriman Eric Merriman
                Reporter:
                bitshftr Shawn Lipscomb
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-13560
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Integration