[TIMOB-14563] iOS: TextField inside TableViewRow only allows 1 character if passwordMask property is true
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-09-03T21:26:47.000+0000 |
Affected Version/s | Release 3.1.1, Release 3.2.0 |
Fix Version/s | 2013 Sprint 18, 2013 Sprint 18 API, Release 3.1.3, Release 3.2.0 |
Components | iOS |
Labels | module_tableviewrow, qe-testadded, regression |
Reporter | Charles de ROMEMONT |
Assignee | Vishal Duggal |
Created | 2013-04-19T08:08:24.000+0000 |
Updated | 2015-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();
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.
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;
Is that test case runnable in a new project? I don't see a createWindow() function.
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:
I kindly request you to reopen this thread and inspect the issue.
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.
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:
Workaround: Place the TextField inside a View
Thanks Christopher. Tested and confirmed on iOS 6 simulator with Ti SDK 3.1.1 GA and 3.2 CI.
master - https://github.com/appcelerator/titanium_mobile/pull/4642 3_1_X - https://github.com/appcelerator/titanium_mobile/pull/4643
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:
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.
[~workingenius] Please add a test case that demonstrates the issue for you.
having the same problem on 3.5.1ga
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.