Uploaded image for project: 'Appcelerator - INBOX'
  1. Appcelerator - INBOX
  2. AC-2738

addEventListener on supperposed elements fired twice on iOS, and once on andrdoid

    Details

      Description

      In the sample code below, there is a view under a label. An addEventListener has been added to the view. The view and the label are different sized.

      The behaviour is different between Android and iOS: The log message is displayed twice on iOS log for one click on the view while it is only displayed once on android.

      app.js

      var element=Titanium.UI.createView({
              top:20,
              height:150,
              left:0,
              width:200,
              backgroundColor:'blue',
              //backgroundImage:Titanium.Filesystem.resourcesDirectory+imageFond,
          });
       
          var lblTxt1=Titanium.UI.createLabel({
              text:'mon label',
              color:'#FFF',
              font : {
                  fontSize : 22,
                  fontFamily : 'Helvetica Neue',
              },
              top:5,
              height:75,
              left:15,
              width:100,
              backgroundColor:'red',
          });
          element.add(lblTxt1);
       
          element.addEventListener('click', function(e){
              Titanium.API.info('addEventListener click sur element:'+e)
          });
       
          win.add(element);
      

      This behaviour is unpleasant because all the code in the eventListener is executed twice....

        Attachments

          Activity

            People

            • Assignee:
              pdowsett Paul Dowsett
              Reporter:
              edomont edouard omont
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Git Integration