Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24223] Universal Windows App (UWP) not getting the correct source.id

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2017-02-03T16:27:15.000+0000
Affected Version/sRelease 6.0.0
Fix Version/sRelease 6.1.0
ComponentsWindows, Windows phone
Labelseng-priority, parity
ReporterNeeraj Mishra
AssigneeKota Iguchi
Created2016-12-14T04:22:05.000+0000
Updated2017-02-09T22:10:55.000+0000

Description

Issue:

When wrapping inner views inside an outer view and adding a click event listener in the outer view, the feedback gotten from the click event object in regards to what the source of the click is, is incorrect IN WINDOWS.

REPRODUCE

1. Create a simple app like attached. 2. Run it on Windows, iOS and Android device. 3. Click on any of the four red squares

ACTUAL RESULT

See the console output prints _evt.source.id==win, even if you explicitly click within the red areas, whereas in iOS and Android, the console prints _evt.source.id==innerWrapper1, _evt.source.id==innerWrapper2 _evt.source.id==innerWrapper3 and _evt.source.id==innerWrapper4, respectively.

EXPECT RESULT

It should work well like it shows output on Android and iOS

Attachments

FileDateSize
6.0.1.GA.PNG2017-02-09T22:04:13.000+00008879
6.0.1.PNG2017-01-25T22:41:22.000+00008996
6.1.0.v20170125103400.PNG2017-01-25T22:41:22.000+00009077
6.1.0.v20170209111025.PNG2017-02-09T22:04:13.000+00009118
6.1.0.v20170209111025 n.PNG2017-02-09T22:04:13.000+00009231
index.js2016-12-14T04:21:24.000+0000127
index.tss2016-12-14T04:21:18.000+0000358
index.xml2016-12-14T04:21:14.000+0000298
Screen Shot 2017-02-07 at 1.58.31 PM.png2017-02-07T21:59:38.000+000028374

Comments

  1. Kota Iguchi 2017-01-09

    I was able to reproduce this. I think this is a parity issue, I remember we had similar issue before: TIMOB-23352
  2. Kota Iguchi 2017-01-12

    https://github.com/appcelerator/titanium_mobile_windows/pull/924
  3. Samir Mohammed 2017-01-25

    Verified fixed with the test case provided in https://github.com/appcelerator/titanium_mobile_windows/pull/924. Was able to see the correct source.id on the multiple views included in the test case. Before: !6.0.1.PNG|thumbnail! After: !6.1.0.v20170125103400.PNG|thumbnail! *Environment*
       Lumia 640 LTE (RM-1073) (OS Build 10.0.14393.693)
       Mobile emulator 10.0.14393.0 1080p 6inch 2gb
       Operating System
       Name                        = Microsoft Windows 10 Pro
       Version                     = 10.0.14393
       Architecture                = 64bit
       

    CPUs = 4

    Memory = 17034395648 Node.js Node.js Version = 4.6.0 npm Version = 2.11.3 Titanium SDK SDK Version = 6.1.0.v20170125103400
  4. Kota Iguchi 2017-02-03

    Reopening this, confirmed that this does not work when View is nested. Here's a sample code (classic).
       var win = Ti.UI.createWindow({
           backgroundColor: 'green',
           id: 'win',
           layout: 'vertical'
       });
       
       var view = Ti.UI.createView({
           backgroundColor: 'white',
           width: Ti.UI.FILL, height: Ti.UI.FILL,
           id: 'view',
           layout: 'vertical'
       });
       
       var view1 = Ti.UI.createView({
           backgroundColor: 'red',
           width: 100, height: 100,
           id: 'view1'
       }),
       view2 = Ti.UI.createView({
           backgroundColor: 'black',
           width: 100, height: 100,
           id: 'view2'
       }),
       view3 = Ti.UI.createView({
           backgroundColor: 'blue',
           width: 100, height: 100,
           id: 'view3'
       }),
       view4 = Ti.UI.createView({
           backgroundColor: 'yellow',
           width: 100, height: 100,
           id: 'view4'
       });
       
       win.addEventListener('click', function (e) {
           alert(e.source.id);
       });
       
       view.add(view1);
       view.add(view2);
       view.add(view3);
       view.add(view4);
       win.add(view);
       win.open();
       
  5. Kota Iguchi 2017-02-03

    https://github.com/appcelerator/titanium_mobile_windows/pull/943
  6. Samir Mohammed 2017-02-07

    Hey [~kota] with the test code provided in https://github.com/appcelerator/titanium_mobile_windows/pull/943 I am still getting no source.id. !Screen Shot 2017-02-07 at 1.58.31 PM.png|thumbnail!
       
       Phone : Lumia 640 LTE (RM-1073)
       Operating System:
       Name                        = Microsoft Windows 10 Pro
       Version                     = 10.0.14393
       Architecture                = 32bit
       

    CPUs = 4

    Memory = 17034395648 Node.js: Node.js Version = 4.6.0 npm Version = 2.15.9 Titanium SDK: SDK Version = 6.1.0.v20170206114448
  7. Samir Mohammed 2017-02-09

    Verified fix with the test case provided in the description and with the test case provided in https://github.com/appcelerator/titanium_mobile_windows/pull/943. With the test case provided in https://github.com/appcelerator/titanium_mobile_windows/pull/943 I was able to see the source.id of a normal view and a nested view. Before: (6.0.1.GA) !6.0.1.GA.PNG|thumbnail! After: (6.1.0.v20170209111025) !6.1.0.v20170209111025.PNG|thumbnail! !6.1.0.v20170209111025 n.PNG|thumbnail! With the test case provided in the description I was able to see the following in the console:
       [INFO] :   _evt.source.id==win
       [INFO] :   _evt.source.id==innerWrapper2
       [INFO] :   _evt.source.id==innerWrapper3
       [INFO] :   _evt.source.id==innerWrapper4
       [INFO] :   _evt.source.id==outerWrapper
       
    *Environment*
       Windows Emulator: 10.0.14393
       Phone : Lumia 640 LTE (RM-1073)
       Operating System:
       Name                        = Microsoft Windows 10 Pro
       Version                     = 10.0.14393
       Architecture                = 32bit
       

    CPUs = 4

    Memory = 17034395648 Node.js: Node.js Version = 4.6.0 npm Version = 2.15.9 Titanium SDK: SDK Version = 6.1.0.v20170209111025

JSON Source