Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15283] iOS: SplitWindow does not respond to focus events

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2013-09-26T21:26:35.000+0000
Affected Version/sn/a
Fix Version/s2013 Sprint 20, 2013 Sprint 20 API, Release 3.1.4, Release 3.2.0
ComponentsiOS
Labelsfocus, module_SplitWindow, module_window, qe-closed-3.1.4, qe-testadded, regression
ReporterSlim McKinsley
AssigneeVishal Duggal
Created2013-09-19T14:55:18.000+0000
Updated2013-09-27T21:27:53.000+0000

Description

This is a regression introduced in Ti SDK 3.1.3.GA (works fine in previous versions including 3.1.3.v20130910153050). SplitWindow on iPad does not fire focus events. Steps to reproduce: 1. Run the attached app.js in iPad Simulator with Ti SDK 3.1.3.GA. 2. Rotate to landscape orientation. 3. After the initial alert, tab Tab 1 or Tab 2 and notice the focus events do not fire as expected. Follow the same steps using Ti SDK 3.1.3.v20130910153050 and notice the focus events DO fire in step 4.

Attachments

FileDateSize
app.js2013-09-19T14:55:18.000+0000781

Comments

  1. Vishal Duggal 2013-09-19

    Test Code is invalid but the bug is valid. SplitWindow treats its master and detail windows as view proxies instead of window proxies. Hence no focus and blur events are fired. Need to fix this.
  2. Eric Merriman 2013-09-19

    Verified occurs with 3.1.3.GA in iPad retina simulator 7 with iOS 7 and Xcode 5 GM. Verified does not occur with 3.1.2.GA in iPad Retina simulator 6.1 with Xcode 5 GM.
  3. Slim McKinsley 2013-09-20

    @Vishal, what's invalid about the test code? Should I not open the tabGroup before adding it to the SplitWindow? What's the proper way to do it?
  4. Eric Merriman 2013-09-24

    [~slim.mckins] I think the comment is related to the fact that either the splitWindow or the tab group should be the top view controller.
  5. Vishal Duggal 2013-09-26

    @[~slim.mckins] Yes you should not be calling open on the tabGroup. Since it is managed by the SplitWindow it is the responsibility of the SplitWindow to open it properly.
  6. Vishal Duggal 2013-09-26

    Test Case With TabGroup and NavWindow and popover functionality
       var tabGroup = Ti.UI.createTabGroup();
       
       var tabWindow1 = Ti.UI.createWindow({
           backgroundColor: 'red'
       });
       
       var tabWindow2 = Ti.UI.createWindow({
           backgroundColor: 'pink'
       });
       
       tabWindow1.addEventListener('focus', function(e) {
           Ti.API.info('tabWindow1 FOCUS');
       });
       
       tabWindow1.addEventListener('blur', function(e) {
           Ti.API.info('tabWindow1 BLUR');
       });
       
       tabWindow2.addEventListener('focus', function(e) {
           Ti.API.info('tabWindow2 FOCUS');
       });
       
       tabWindow2.addEventListener('blur', function(e) {
           Ti.API.info('tabWindow2 BLUR');
       });
       
       var tab1 = Ti.UI.createTab({
           tintColor: 'black',
           title: 'Tab 1',
           window: tabWindow1
       });
       
       var tab2 = Ti.UI.createTab({
           tintColor: 'black',
           title: 'Tab 2',
           window: tabWindow2
       });
       
       tabGroup.addTab(tab1);
       tabGroup.addTab(tab2);
       
       
       var detailWindow = Ti.UI.createWindow({
           backgroundColor: 'gray'
       });
       
       var navWindow = Ti.UI.iOS.createNavigationWindow({
           window: detailWindow
       })
       
       var splitWindow = Ti.UI.iPad.createSplitWindow({
           detailView: navWindow,
           masterView: tabGroup,
       }); 
        
       splitWindow.addEventListener('visible',function(e){
           if (e.view == 'detail') {
               e.button.title = "Popover";
               detailWindow.leftNavButton = e.button;
           }
           else if (e.view == 'master') {
               detailWindow.leftNavButton = null;
           }
       })
       
       splitWindow.open();
       
  7. Vishal Duggal 2013-09-26

    Pull pending master - https://github.com/appcelerator/titanium_mobile/pull/4740 3_1_X - https://github.com/appcelerator/titanium_mobile/pull/4741
  8. Olga Romero 2013-09-27

    Tested and verified respond to focus events with: Appcelerator Studio, build: 3.1.3.201309132456 Titanium SDK, build: 3.1.4.v20130926144546 CLI 3.1.2 Alloy 1.2.2 Device: iPad mini iOS 7.0.2 (11A501)

JSON Source