Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-7998] iOS: Keypad displayed in the middle of the window on iOS

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-10-04T17:20:30.000+0000
Affected Version/sRelease 1.7.5, Release 1.8.2
Fix Version/sRelease 2.0.0, Sprint 2012-06, Release 2.1.3, Release 3.0.0
ComponentsiOS
Labelsmodule_textfield, qe-ios090112, qe-testadded, regression
ReporterEduardo Gomez
AssigneeMax Stepanov
Created2012-03-14T11:54:45.000+0000
Updated2012-10-04T17:20:30.000+0000

Description

Issue

Keypad is displayed in the middle of the window on iOS closing a child window, i.e. as seen in the screenshot attached.

Tested on

iOS simulator 4.3 & 5 iPhone 4

Reproduction steps

1. Launch the app 2. click on the text field, click the return key 3. window 2 will open in the landscape mode. 4. tilt the phone to landscape. 5. click on the window2. it will close and display parent window 6. once parent window is displayed, click on the text field 7. tilt the phone to portrait.

Repro sequence

// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');

// create tab group
var tabGroup = Titanium.UI.createTabGroup();

// create base UI tab and root window
//

tabGroup.addEventListener('focus',function(e){
	win1.orientationModes=[
	Titanium.UI.PORTRAIT,
     Titanium.UI.LANDSCAPE_LEFT,
     Titanium.UI.LANDSCAPE_RIGHT
 ];
});

var win1 = Titanium.UI.createWindow({  
    title:'Tab 1',
    backgroundColor:'#fff'
});
win1.orientationModes=[
	Titanium.UI.PORTRAIT,
     Titanium.UI.LANDSCAPE_LEFT,
     Titanium.UI.LANDSCAPE_RIGHT
 ];
var tab1 = Titanium.UI.createTab({  
    icon:'KS_nav_views.png',
    title:'Tab 1',
    window:win1
});

gl = {};

var label1 = Titanium.UI.createLabel({
	color:'#999',
	text:'I am Window 1',
	font:{fontSize:20,fontFamily:'Helvetica Neue'},
	textAlign:'center',
	width:'auto'
});
	var winTxtField = Titanium.UI.createTextField({
   			color:'#ff7c00',
   			font: {
				fontSize:16,
				fontWeight:'bold',
				fontFamily:'Helvetica Neue'
			},
    		top:9,
    		textAlign : 'right',
    		height:46,
    		bottom:15,
    		width: '100%',
    		keyboardType:Titanium.UI.KEYBOARD_NUMBERS_PUNCTUATION,
    		returnKeyType:Titanium.UI.RETURNKEY_DEFAULT,
    		borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED,
    		borderColor:'blue',
    		borderWidth:2
		});

Ti.include('win2.js');

winTxtField.addEventListener('return',function(){
	gl.createNewWindow();
});

win1.add(winTxtField);

tabGroup.addTab(tab1);  
  
tabGroup.open();
gl.createNewWindow = function(){
	var win2 = Titanium.UI.createWindow({  
    title:'I am window2',
    backgroundColor:'blue'
});
win2.orientationModes=[
     Titanium.UI.LANDSCAPE_LEFT,
     Titanium.UI.LANDSCAPE_RIGHT
 ];
 
 win2.open();
  win2.addEventListener('click',function(e){
  	 //winTxtField.focus();//don't need this
  	 //Ti.UI.orientation = Ti.UI.PORTRAIT;//if you need to update to PORTRAIT mode
 	 //Ti.Android.currentActivity.setRequestedOrientation(Ti.Android.SCREEN_ORIENTATION_PORTRAIT);
 	 Ti.UI.orientation = Titanium.Gesture.orientation;
 	 win2.close();
 });
};

Attachments

FileDateSize
KeyPad_middle.png2012-03-14T11:54:45.000+0000119758

Comments

  1. Max Stepanov 2012-03-16

    Update test case to address text widget visibility in 2.0.0
  2. Sabil Rahim 2012-03-18

    Accepted the initial [PR 1718](https://github.com/appcelerator/titanium_mobile/pull/1718) which fixes the issue. Keeping the ticket open to see if we can resolve the visual glitch where by the keyboard animates down to its correct position.
  3. Wilson Luu 2012-03-19

    Closing bug. Verified fix on: SDK build: 2.0.0.v20120319003254 Titanium Studio, build: 2.0.0.201203182248 xcode: 4.2 Device: iphone 4 (5.1)
  4. Wilson Luu 2012-04-20

    Reopening to update labels.
  5. Tamila Smolich 2012-10-02

    Reopening issue and adding a "regression" label, since the behavior does not occur on 2.1.2. Tested on: OS: Mac OS X Lion 10.7.4 Titanium Studio, build: 2.1.2.201208301612 Titanium SDK, build: 2.1.3.v20121002110115; 2.1.3.v20120928203111 Devices: iPhone 5 (6.0.GM), iPhone 4 (5.1.1) Note: After step 3 from description do not rotate the device to lanscape mode, keep it in portrait.
  6. Sabil Rahim 2012-10-02

    FIXED ON MASTER BY https://github.com/appcelerator/titanium_mobile/pull/3098 FIXED ON 2_1_X BY https://github.com/appcelerator/titanium_mobile/pull/3099 INTRODUCED BY FIX FOR TIMOB-11023
  7. Sabil Rahim 2012-10-02

    reintroduced by fix for timob-11023, so linking it here.
  8. Sabil Rahim 2012-10-02

    doing CR & FR against all regressing tickets.
  9. Olga Romero 2012-10-03

    Closing as fixed. Verified with: Titanium Studio, build: 2.1.2.201208301612 Titanium Studio, SDK: 2.1.3.GA Titanium Studio, SDK: 3.0.0.v20121003162513 Device: iPhone4 ios 6.0 Simulator 6.0
  10. Olga Romero 2012-10-04

    reopening to edit comment

JSON Source