Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-14563] iOS: TextField inside TableViewRow only allows 1 character if passwordMask property is true

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-09-03T21:26:47.000+0000
Affected Version/sRelease 3.1.1, Release 3.2.0
Fix Version/s2013 Sprint 18, 2013 Sprint 18 API, Release 3.1.3, Release 3.2.0
ComponentsiOS
Labelsmodule_tableviewrow, qe-testadded, regression
ReporterCharles de ROMEMONT
AssigneeVishal Duggal
Created2013-04-19T08:08:24.000+0000
Updated2015-04-23T10:03:54.000+0000

Description

*Problem* When passwordMask is set to true on a textField inside a TableViewRow, the user is able to only type 1 character. When set to false or not included at all, it works just fine. *Test case*
var win = Ti.UI.createWindow({
	backgroundColor : "#000"
});

var tableData = [];

for (var i = 1; i <= 5; i++) {
	var row = Ti.UI.createTableViewRow({
		className : 'passwordTest',
		selectedBackgroundColor : 'white'
	});
	var input = Ti.UI.createTextField({
		font : {
			fontSize : 16,
			fontFamily : 'Helvetica Neue'
		},
		backgroundColor : "#FFF",
		width : 290,
		paddingLeft : 10,
		paddingRight : 10,
		autocapitalization : Titanium.UI.TEXT_AUTOCAPITALIZATION_NONE,
		autocorrect : false,
		passwordMask : true /* Removing this or setting it to false makes the input field behave as expected */
	});
	row.add(input);

	tableData.push(row);
}

var tableView = Ti.UI.createTableView({
	backgroundColor : 'white',
	data : tableData
});

win.add(tableView);
win.open();

Comments

  1. Daniel Sefton 2013-04-19

    Hi Charles, Firsly, is this a regression? Does it occur with previous versions of the SDK? Can you clarify if you're using 3.1 GA? Also please add a simple runnable test case that we can drop into an app.js and run. Thanks.
  2. Charles de ROMEMONT 2013-05-10

    With previous version, no problem i use 3.1GA var textfieldDefaults = { font : { fontSize : 16, fontFamily : 'Helvetica Neue' }, width : 270, paddingLeft: 20, autocapitalization : Titanium.UI.TEXT_AUTOCAPITALIZATION_NONE, //borderStyle : Titanium.UI.INPUT_BORDERSTYLE_NONE, clearButtonMode:Titanium.UI.INPUT_BUTTONMODE_ALWAYS, autocorrect : false }; // Login field var loginTextfield = Ti.UI.createTextField(textfieldDefaults); loginTextfield.hintText = localizedStrings['Email:']; loginTextfield.keyboardType = Titanium.UI.KEYBOARD_EMAIL; loginTextfield.returnKeyType = Titanium.UI.RETURNKEY_NEXT; row.add(loginTextfield); data.push(row); // Password field var row = Ti.UI.createTableViewRow({ hasChild: false, height: 'auto' }); var passwordTextfield = Ti.UI.createTextField(textfieldDefaults); passwordTextfield.hintText = localizedStrings['Password:']; passwordTextfield.returnKeyType = Titanium.UI.RETURNKEY_JOIN; //passwordTextfield.passwordMask = true;
  3. Daniel Sefton 2013-05-10

    Is that test case runnable in a new project? I don't see a createWindow() function.
  4. Nikhil N 2013-06-18

    Hi Daniel, this issue was introduced in 3.0.2.GA The passwordMask property worked as expected in 3.0.0.GA and previous versions. Code to reproduce the bug:
       var win = Ti.UI.createWindow({
           width: Ti.UI.FILL,
           height: Ti.UI.FILL,
           backgroundColor: "#ffffff"
       });
       
       var input = Ti.UI.createInputField({
           font : { fontSize : 16, fontFamily : 'Helvetica Neue' },
           width : 270,
           paddingLeft: 20,
           paddingRight: 20,
           autocapitalization : Titanium.UI.TEXT_AUTOCAPITALIZATION_NONE,
           autocorrect : false,
           passwordMask: true /* Removing this or setting it to false makes the input field behave as expected */
       });
       
       win.add(input);
       win.open();
       
    I kindly request you to reopen this thread and inspect the issue.
  5. Daniel Sefton 2013-06-19

    I can't reproduce this on iOS 6 simulator with Ti SDK 3.0.2 GA or 3.1.1 GA. If I run the example I placed in the description, I can type any number of characters without issue.
  6. Christopher Beloch 2013-07-16

    I can reproduce this issue, placing the textfield inside a tableviewrow. If i set passwordMask to false, everything is ok, setting it to true will only allow 1 character. TiSDK 3.1.1.GA Alloy example:
       <Window>
       	<TableView>
       		<TableViewRow>
       			<TextField
       				 width="Ti.UI.FILL"
       				passwordMask="true" />
       		</TableViewRow>
       	</TableView>
       </Window>
       
    Workaround: Place the TextField inside a View
  7. Daniel Sefton 2013-07-16

    Thanks Christopher. Tested and confirmed on iOS 6 simulator with Ti SDK 3.1.1 GA and 3.2 CI.
  8. Vishal Duggal 2013-09-03

    master - https://github.com/appcelerator/titanium_mobile/pull/4642 3_1_X - https://github.com/appcelerator/titanium_mobile/pull/4643
  9. Priya Agarwal 2013-09-09

    Verified the fixed with: Appc Studio: 3.1.3.201309072408 Sdk:3.1.3.v20130908095038 CLI version : 3.1.2 Alloy : 1.2.2-beta MAC OSX: 10.8.4 XCode : 5beta6 Device: Iphone5(v7),ipad4(v6) Now the textfield inside tableView with password Mask property works fine.(allows more than one character to be inserted) Verified the fix with code:
       var win = Ti.UI.createWindow({
           backgroundColor : "white"
       });
        
       var tableData = [];
        
       for (var i = 1; i <= 5; i++) {
           var row = Ti.UI.createTableViewRow({
           });
           var input = Ti.UI.createTextField({
               font : {
                   fontSize : 16,
                   fontFamily : 'Helvetica Neue'
               },
               backgroundColor : "white",
               borderColor:'black',
               width : 290,
               paddingLeft : 5,
               paddingRight : 5,
               height:'35',
               autocapitalization : Titanium.UI.TEXT_AUTOCAPITALIZATION_NONE,
               autocorrect : false,
               passwordMask : true
           });
           row.add(input);
        
           tableData.push(row);
       }
        
       var tableView = Ti.UI.createTableView({
           backgroundColor : 'white',
           top:'10',
           data : tableData,
           height:Ti.UI.SIZE
       });
        
       win.add(tableView);
       win.open();
       
  10. 商汝麒 2015-02-14

    I'm sorry, this issue is found again in sdk 3.5.0.GA. It seems that I can't reopen this issue, please check. thank you.
  11. Ingo Muschenetz 2015-02-16

    [~workingenius] Please add a test case that demonstrates the issue for you.
  12. João Serra 2015-04-22

    having the same problem on 3.5.1ga
  13. João Serra 2015-04-23

    seems setting the width or height of the textfield is a workarround for the problem. I just tried the width and it worked. People were saying it also works with height.

JSON Source