Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15297] iOS7: KeyboardToolbar disappears when toggling between textfields

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionInvalid
Resolution Date2013-09-20T19:23:13.000+0000
Affected Version/sRelease 3.1.3
Fix Version/s2013 Sprint 19, 2013 Sprint 19 API
ComponentsiOS
Labelsios7, regression, triage
ReporterMeenakshi Pathak
AssigneeVishal Duggal
Created2013-09-20T11:36:03.000+0000
Updated2017-03-29T16:38:37.000+0000

Description

KeyboardToolbar of textfields disappears while toggling between the textfields. *Steps To Reproduce*: 1. Copy and paste the below code in newly created Titanium project:

var win = Ti.UI.createWindow({
	backgroundColor:'white'
});

 var previous = Titanium.UI.createButton({
	title :'Previous',
    style :Titanium.UI.iPhone.SystemButtonStyle.DONE,
	});

var next = Titanium.UI.createButton({
	title :'Next',
    style :Titanium.UI.iPhone.SystemButtonStyle.DONE,
	});

var username = Titanium.UI.createTextField({
			width : '88.1%',
			height : '8.9%',
			hintText : 'NT USERNAME',		
			top : 50,
			borderStyle : Titanium.UI.INPUT_BORDERSTYLE_ROUNDED,
			autocapitalization : Titanium.UI.TEXT_AUTOCAPITALIZATION_NONE,
			keyboardToolbar : [previous, next]
		});
var password = Titanium.UI.createTextField({
			width : '88.1%',
			height : '8.9%',
			hintText : 'NT PASSWORD',		
			top : 100,
			borderStyle : Titanium.UI.INPUT_BORDERSTYLE_ROUNDED,
			passwordMask : true,
			autocapitalization : Titanium.UI.TEXT_AUTOCAPITALIZATION_NONE,
			keyboardToolbar : [previous, next]
		});
    
 previous.addEventListener('click', function (e) { 
 	username.focus(); 
 	
 	
});
 next.addEventListener('click', function (e) {
 	 password.focus(); 
 	 	
 	});

 username.addEventListener('focus', function (e) {
 	  
         previous.enabled=false; next.enabled=true; 
          
 });
 
  password.addEventListener('focus', function (e) { 
         previous.enabled=true; next.enabled=false;
        
 
 });
	
win.add(username);
win.add(password);

win.open();
2. Run the app on iOS7 and toggle between textfields. *Note* :This behavior is specifically on iOS7. This issue can not be seen on iOS6 and SDK 3.1.0.Find the attachment of blank KeyboardToolBar after toggling between textFields.

Attachments

FileDateSize
Screen Shot 2013-09-20 at 5.03.48 PM.png2013-09-20T11:36:03.000+000046630

Comments

  1. Vishal Duggal 2013-09-20

    You can not use the same view proxies in two different toolbars. You can however use the same toolbar on two different view proxies (although that too is considered bad UI design) Create a toolbar explicitly and set it to the textfields. To get the toolbar switching effect use 4 buttons or 2 toolbars. Code with single toolbar:
       var win = Ti.UI.createWindow({
           backgroundColor:'white'
       });
        
       var previous = Titanium.UI.createButton({
           title :'Previous',
           style :Titanium.UI.iPhone.SystemButtonStyle.DONE,
           });
        
       var next = Titanium.UI.createButton({
           title :'Next',
           style :Titanium.UI.iPhone.SystemButtonStyle.DONE,
           });
       
       var toolbar = Titanium.UI.iOS.createToolbar({
           items:[previous,next],
           borderTop:true,
           borderBottom:false
       }); 
       
       var username = Titanium.UI.createTextField({
                   width : '88.1%',
                   height : '8.9%',
                   hintText : 'NT USERNAME',       
                   top : 50,
                   borderStyle : Titanium.UI.INPUT_BORDERSTYLE_ROUNDED,
                   autocapitalization : Titanium.UI.TEXT_AUTOCAPITALIZATION_NONE,
                   keyboardToolbar : toolbar
               });
       var password = Titanium.UI.createTextField({
                   width : '88.1%',
                   height : '8.9%',
                   hintText : 'NT PASSWORD',       
                   top : 100,
                   borderStyle : Titanium.UI.INPUT_BORDERSTYLE_ROUNDED,
                   passwordMask : true,
                   autocapitalization : Titanium.UI.TEXT_AUTOCAPITALIZATION_NONE,
                   keyboardToolbar : toolbar
               });
            
       previous.addEventListener('click', function (e) { 
           username.focus(); 
       });
       
       next.addEventListener('click', function (e) {
            password.focus(); 
       });
       
       username.addEventListener('focus', function (e) {
           previous.enabled=false; next.enabled=true; 
       });
         
       password.addEventListener('focus', function (e) { 
           previous.enabled=true; next.enabled=false;
       });
           
       win.add(username);
       win.add(password);
        
       win.open();
       
  2. Lee Morris 2017-03-29

    Closing ticket as invalid.

JSON Source