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

iOS: TableViewRow .hasCheck bug when used in combination with highlightedColor

    Details

      Description

      If you set the hasCheck property on a tableViewRow on a click event, then the highlightedColor on any labels within that tableViewRow gets stuck.

      tableview.addEventListener('click', function(e) {
          currRow.setHasCheck(false);
          currRow.label.setColor('#000');
          currRow = e.row;
          e.row.setHasCheck(true);
          e.row.label.setColor('#324f85');
      });
      

      The label within that row has a highlightedColor of #fff. When clicking on a row, the label turns permanently white. Selecting it again fixes the problem.

      A workaround is to call setHasCheck twice, while setting the font color explicitly in between the two calls:

      tableview.addEventListener('click', function(e) {
          currRow.setHasCheck(false);
          currRow.label.setColor('#000');
          currRow = e.row;
          e.row.setHasCheck(true);
          e.row.label.setColor('#324f85');
          // need to set hasCheck again to get around Titanium 3.0.0 bug
          e.row.setHasCheck(true);
      });
      

      This will still cause the same bug if the row is selected twice in a row now. To work around that, you have to make sure that this row isn't already selected.

      This bug was introduced in Titanium 3.0.0. I am building using the iOS 6 sdk with Titanium Studio 3.0. The problem exists in both the simulator and on a physical iPhone 5 device.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                vduggal Vishal Duggal (Inactive)
                Reporter:
                neilgupta Neil Gupta
                Reviewer:
                Sabil Rahim
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Integration