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

Windows: removeEventListener removes wrong callback

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: Release 8.0.0
    • Fix Version/s: Release 8.1.0
    • Component/s: Windows
    • Labels:
      None
    • Story Points:
      5
    • Sprint:
      2019 Sprint 3, 2019 Sprint 5

      Description

      removeEventListener removes wrong callback. If module has multiple callbacks with same name, removeEventListener always removes first one only.

      var win = Ti.UI.createWindow();
       
      var func1 = function () {
          Ti.API.info('open callback 1');
      };
       
      var func2 = function () {
          Ti.API.info('open callback 2');
      };
       
      var func3 = function () {
          Ti.API.info('open callback 3');
      };
       
       
      win.addEventListener('open', func1);
      win.addEventListener('open', func1);
      win.addEventListener('open', func2);
      win.addEventListener('open', func2);
      win.addEventListener('open', func3);
      win.addEventListener('open', func3);
       
      win.removeEventListener('open', func2);
       
      win.open();

      Actual: func1 called once and func2 & func3 are called twice.
      Expected: all func2 should be removed and func1 & func3 should be called twice.

        Attachments

          Activity

            People

            • Assignee:
              kiguchi Kota Iguchi
              Reporter:
              kiguchi Kota Iguchi
              Reviewer:
              Gary Mathews
              Tester:
              Keerthi Mahalingam
            • Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Source Code