Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9488] MobileWeb: Focus event in tabgroup not being fired

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionWon't Fix
Resolution Date2018-04-04T23:57:42.000+0000
Affected Version/sRelease 2.1.0, Release 3.2.0
Fix Version/sn/a
ComponentsMobileWeb
LabelsSupportTeam, parity
ReporterMauro Parra-Miranda
AssigneeChris Barber
Created2012-06-11T15:38:20.000+0000
Updated2018-04-05T00:00:03.000+0000

Description

Problem Description

Tabgroup's focus event is not working as with iOS.

Actual Results

The focus event is never fired

Expected results

The focus event should fire.

Testcase

1. Create new mobile Project. 2. Paste app.js:
Titanium.UI.setBackgroundColor('#000');

// create tab group
var tabGroup = Titanium.UI.createTabGroup();
var  win = Titanium.UI.createWindow({
                    backgroundColor:'white',
                    title:'window',
                    barColor:'#ff7b01',
                    top:0,
                    navBarHidden:false
                });
                
/* win.addEventListener('focus',function(){
	alert('focus');
}); */
    var tab1 = Titanium.UI.createTab({  
    icon:'KS_nav_views.png',
    title:'Tab 1',
    window:win
});       
 var tab2 = Titanium.UI.createTab({  
    icon:'KS_nav_views.png',
    title:'Tab 2',
    window:win
});          
                var titleImage = Ti.UI.createView({
							width:94,
							height:24,
							backgroundImage:'/images/header/ing_logo_header.png',
						});
						win.titleControl = titleImage;
						
//win.open();
tabGroup.addTab(tab1);  
tabGroup.addTab(tab2);
tabGroup.open();
tabGroup.addEventListener('focus',function(){
	alert('focus tabs fired')
});
tabGroup.addEventListener('click',function(){
	alert('click fired')
});
3. Test this code in iOS, compare with this code in MobileWeb.

Comments

  1. Chris Barber 2012-06-11

    Mobile Web does not blur and re-focus the TabGroup when you change a tab because Mobile Web does not bubble events like iOS. Frankly, blurring and re-focusing the TabGroup when a tab is switched is pointless. Use the "focus" event on a TabGroup to know when a window is closed and the TabGroup regains focus. Use the "click" event on TabGroup to know when a tab has changed. Listen on a specific Tab to know when that Tab is clicked, focused, or blurred.
  2. Chris Barber 2012-06-12

    I fixed events on TabGroups and Tabs in TIMOB-9176. The focus event for a TabGroup is fired either when the TabGroup is opened or when a Window is closed and the TabGroup regains focus. The TabGroup should not blur and re-focus every time you change tabs. That's a bug with iOS and Android. I'm working with Josh from the Android team to come up with a consensus with this. As of right now, Mobile Web's implementation is not bound to change for v2.1.
  3. Eric Merriman 2018-04-04

    Closing as will not fix
  4. Eric Merriman 2018-04-05

    Closing as will not fix

JSON Source