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

iOS: Click event is fired even when click is outside the icon of an item in the Titanium.UI.DashboardView

    Details

    • Sprint:
      Release 3.0.0

      Description

      Problem description

      When the icon that represents an item inside a DashboardView is smaller than the "cell" size, clicking outside the icon fires the 'click' event.

      Steps to reproduce

      • Use the following code:

      var win = Ti.UI.createWindow({
          backgroundColor: '#444'
      });
       
      var dashboardData = [];
      var itemData = [
        { name: 'account', badge: 10 },
        { name: 'cases', badge: 2 },
        { name: 'calls', badge: 2 },
        { name: 'contacts', badge: 5},
        { name: 'emps' }, 
        { name: 'leads' },
        { name: 'meetings', badge: 3 },
        { name: 'opps',  badge:  126 }, // badge will be displayed as "99+"
        { name: 'tasks' }
      ];
       
      for (var i=0, ilen=itemData.length; i<ilen; i++){
        var item = Ti.UI.createDashboardItem({
          badge: itemData[i].badge,
          image: '/images/test.png',
          label: itemData[i].name
        });
        dashboardData.push(item);
      }
       
      var dashboard = Ti.UI.createDashboardView({
        data: dashboardData,
        wobble: true
      });
      win.add(dashboard);
       
      dashboard.addEventListener('click', function(e){
        alert('Fired on ' + e.location.x +  ' ' + e.location.y + '!');
      });
       
      win.open();
      

      • Make sure the icons used are smaller than the cell size
      • Run the app and click outside the icon: the click event is fired

      Note

      The x-y value returned in the click event is fixed for each element, no metter where the user clicks. In particular, first element is always 0-0, second 256-0, third 512-0 etc.

        Attachments

          Activity

            People

            • Assignee:
              vduggal Vishal Duggal (Inactive)
              Reporter:
              dcassenti Davide Cassenti
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Integration