Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8677] iOS: Window Open event in navgroup fired unexpectedly

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionCannot Reproduce
Resolution Date2012-04-26T11:02:15.000+0000
Affected Version/sRelease 2.0.0
Fix Version/sn/a
ComponentsiOS
Labelsapi, navgroup
ReporterFrank Apap
AssigneeVishal Duggal
Created2012-04-11T08:37:10.000+0000
Updated2017-03-20T22:16:37.000+0000

Description

If you have a navgroup that has window A open, then open window B and finally close window B - window A's OPEN event is fired on the close of Window B. This doesn't happen when the windows are not part of a navgroup. In this example code win1's open event fires when clicking label2 (to close win2). ~~~ // this sets the background color of the master UIView (when there are no windows/tab groups on it) Titanium.UI.setBackgroundColor('#000'); navWindow = Ti.UI.createWindow(); // // create base UI tab and root window // var win1 = Titanium.UI.createWindow({ title:'Tab 1', backgroundColor:'#fff' }); var label1 = Titanium.UI.createLabel({ color:'#999', text:'I am Window 1 - Click to open win 2', font:{fontSize:20,fontFamily:'Helvetica Neue'}, textAlign:'center', width:'auto' }); win1.add(label1); win1.addEventListener('open',function(e){ Ti.API.info("OPENEVENT"); }); navGroup = Ti.UI.iPhone.createNavigationGroup({ window: win1 }); navWindow.add(navGroup); navWindow.open(); // // create controls tab and root window // label1.addEventListener('click', function(e){ var win2 = Titanium.UI.createWindow({ title:'Tab 2', backgroundColor:'#fff' }); var label2 = Titanium.UI.createLabel({ color:'#999', text:'I am Window 2', font:{fontSize:20,fontFamily:'Helvetica Neue'}, textAlign:'center', width:'auto' }); label2.addEventListener('click',function(e){ navGroup.close(win2); }); win2.add(label2); navGroup.open(win2); }); ~~~

Comments

  1. Kevin Whinnery 2012-04-11

    I think the correct behavior here should be the window focus event.
  2. Frank Apap 2012-04-11

    Kevin, that makes total sense to me.
  3. Vishal Duggal 2012-04-26

    Can not reproduce on latest master
  4. Frank Apap 2012-05-20

    I took the latest 2.0.2 build and it's still happening.
  5. Neeraj Gupta 2012-05-22

    @Frank - can you please try it out with the master (2.1.0) build as we cannot reproduce this issue with the latest master build?
  6. Lee Morris 2017-03-20

    Closing ticket as duplicate.

JSON Source