Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-7834] iOS: Cannot focus on textfield when included in rightnavButton

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionCannot Reproduce
Resolution Date2017-06-23T20:24:24.000+0000
Affected Version/sRelease 1.7.5, Release 1.8.0.1, Release 2.0.1
Fix Version/sn/a
Componentsn/a
Labelsn/a
ReporterDevang Gandhi
AssigneeEric Merriman
Created2012-02-27T21:16:16.000+0000
Updated2017-06-23T20:24:24.000+0000

Description

Textfield when used in rightnav button, in a tabbed group does not focus. Expected behavior: When tf.focus(); is executed the textfield is supposed to focus. Actual Behavior: Textfield is not focussed correctly.

Comments

  1. Devang Gandhi 2012-02-27

       Titanium.UI.setBackgroundColor('#000');
       
       // create tab group
       var tabGroup = Titanium.UI.createTabGroup();
       
       
       //
       // create base UI tab and root window
       //
       var win1 = Titanium.UI.createWindow({  
           title:'Tab 1',
           backgroundColor:'#fff'
       });
       var tab1 = Titanium.UI.createTab({  
           icon:'KS_nav_views.png',
           title:'Tab 1',
           window:win1
       });
       
       var label1 = Titanium.UI.createLabel({
           color:'#999',
           text:'I am Window 1',
           font:{fontSize:20,fontFamily:'Helvetica Neue'},
           textAlign:'center',
           width:'auto'
       });
       
       win1.add(label1);
       var tfContainerView = Titanium.UI.createView({
           height: 39,
           width: 120,
           backgroundColor: '#123456'
       });
       var tf = Titanium.UI.createTextField({
           top: 1,
           left: 10,
           width: 100,
           height: 38,
           font: {fontSize:15, fontStyle:'italic'},
           color: '#000',
           hintText: 'Wo?',
           clearButtonMode: Titanium.UI.INPUT_BUTTONMODE_ALWAYS,
           backgroundColor: '#fff',
           paddingLeft: 10
       });
       tfContainerView.add( tf );
       win1.setRightNavButton( tfContainerView );
       // setTimeout(function() {
           tf.focus();
       // }, 2000 );
       
       //
       // create controls tab and root window
       //
       var win2 = Titanium.UI.createWindow({  
           title:'Tab 2',
           backgroundColor:'#fff'
       });
       var tab2 = Titanium.UI.createTab({  
           icon:'KS_nav_ui.png',
           title:'Tab 2',
           window:win2
       });
       
       var label2 = Titanium.UI.createLabel({
           color:'#999',
           text:'I am Window 2',
           font:{fontSize:20,fontFamily:'Helvetica Neue'},
           textAlign:'center',
           width:'auto'
       });
       
       win2.add(label2);
       
       
       
       //
       //  add tabs
       //
       tabGroup.addTab(tab1);  
       tabGroup.addTab(tab2);  
       
       
       // open tab group
       tabGroup.open();
       
  2. Junaid Younus 2012-05-18

    Tested with 2.0.1GA2 on the iOS simulator, issue still exists.
  3. Lee Morris 2017-06-23

    I am unable to reproduce this issue with the following environment; iPhone 7 (10.2) Studio 4.9.0.201705302345 Ti SDK 6.1.1.v20170620103414 Appc NPM 4.2.9 Appc CLI 6.2.1 Ti CLI 5.0.13 Alloy 1.9.11 Arrow 2.0.0 Xcode 8.2 (8C38) Node v4.8.2 Java 1.8.0_131

JSON Source