{ "id": "123141", "key": "AC-2247", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "11", "description": "Is not a bug in our product", "name": "Not Our Bug" }, "resolutiondate": "2013-12-04T18:12:35.000+0000", "created": "2013-12-03T14:34:46.000+0000", "labels": [ "attributedString", "iphone", "passwordmask", "textfield", "triage" ], "versions": [], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2016-03-08T07:41:15.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [], "description": "attributedString doesn't work properly with TextField that has passwordMask.\r\n\r\nh2. Steps to reproduce:\r\n- Start the application\r\n- Click (Focus) second TextField with password.\r\n- Click (Focus) first TextField without passwordMask property\r\n- *TextField with password will lose its style*\r\n\r\n*index.tss*\r\n{code:javascript}\r\n\"Window\":{\r\n\tbackgroundColor: \"black\"\r\n}\r\n\r\n\"TextField\":{\r\n\twidth: 300, height: 40,\r\n\ttop: 10,\r\n\tbackgroundColor: \"#B2B2B2\",\r\n\tborderColor: \"red\"\r\n}\r\n{code}\r\n\r\n*index.xml*\r\n{code:xml}\r\n\r\n \r\n \t\r\n\t \t\r\n\t \t\r\n \t\r\n \r\n\r\n{code}\r\n\r\n*index.js*\r\n{code:javascript}\r\nvar text = \"text\";\r\n\r\n$.textField_1.attributedString = Ti.UI.iOS.createAttributedString({\r\n\ttext: text,\r\n\tattributes: [\r\n\t\t{\r\n\t\t\ttype: Ti.UI.iOS.ATTRIBUTE_FOREGROUND_COLOR,\r\n\t\t\tvalue: \"white\",\r\n\t\t\trange: [0, text.length]\r\n\t\t}\r\n\t]\r\n});\r\n \r\n\r\n$.textField_2.attributedString = Ti.UI.iOS.createAttributedString({\r\n\ttext: text,\r\n\tattributes: [\r\n\t\t{\r\n\t\t\ttype: Ti.UI.iOS.ATTRIBUTE_FOREGROUND_COLOR,\r\n\t\t\tvalue: \"white\",\r\n\t\t\trange: [0, text.length]\r\n\t\t}\r\n\t]\r\n});\r\n\r\n$.win.open();\r\n{code}\r\n\r\n", "attachment": [], "flagged": false, "summary": "iOS: (3.2.0) attributedString doesn't work properly with TextField and passwordMask", "creator": { "name": "sko", "key": "sko", "displayName": "Matej", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "sko", "key": "sko", "displayName": "Matej", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Ti SDK: 3.2.0.v20131127194046", "comment": { "comments": [ { "id": "282419", "author": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "body": "This is an iOS issue as demonstrated in this native iOS code: http://pastie.org/8528800\r\n\r\nh3. Workaround:\r\nCreate a new attributed string on textfield blur\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor: '#fff'\r\n});\r\n\r\nvar text = \"text\";\r\n\r\nfunction FieldAttribute(_text) {\r\n\treturn Ti.UI.iOS.createAttributedString({\r\n\t text: _text,\r\n\t attributes: [\r\n\t {\r\n\t type: Ti.UI.iOS.ATTRIBUTE_FOREGROUND_COLOR,\r\n\t value: \"white\",\r\n\t range: [0, _text.length]\r\n\t }\r\n\t ]\r\n\t});\r\n}\r\n\r\nvar textField = Ti.UI.createTextField({\r\n\twidth: 300, height: Ti.UI.SIZE, top: 100,\r\n backgroundColor: '#B2B2B2',\r\n borderColor: 'red',\r\n passwordMask: true,\r\n attributedString: FieldAttribute(text)\r\n});\r\n\r\nwin.add(textField);\r\n\r\nwin.open();\r\n\r\ntextField.addEventListener('blur', function(e){\r\n\ttextField.attributedString = FieldAttribute(e.value);\r\n});\r\n\r\n{code}", "updateAuthor": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-12-04T18:12:35.000+0000", "updated": "2013-12-04T18:12:35.000+0000" }, { "id": "282693", "author": { "name": "sko", "key": "sko", "displayName": "Matej", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi Pedro, thanks for workaround ,but I have another problem. Try to change a little bit attributes:\r\n\r\n{code:javascript}\r\nattributes: [\r\n\t\t\t{\r\n\t\t\t\ttype: Ti.UI.iOS.ATTRIBUTE_FOREGROUND_COLOR,\r\n\t\t\t\tvalue: \"white\",\r\n\t\t\t\trange: [0, text.length]\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\ttype: Ti.UI.iOS.ATTRIBUTE_FONT,\r\n\t\t\t\tvalue: {fontSize: 10, fontFamily: \"Avenir-Medium\"},\r\n\t\t\t\trange: [0, text.length]\r\n\t\t\t}\r\n\t\t]\r\n{code}\r\n\r\nand font will change also its size. I have tried to make workaround using focus&blur events ,but unsuccessfully. Can you help me with that please? Thanks", "updateAuthor": { "name": "sko", "key": "sko", "displayName": "Matej", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-12-05T20:46:31.000+0000", "updated": "2013-12-05T20:47:25.000+0000" }, { "id": "283799", "author": { "name": "sko", "key": "sko", "displayName": "Matej", "active": true, "timeZone": "America/Los_Angeles" }, "updateAuthor": { "name": "sko", "key": "sko", "displayName": "Matej", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-12-11T11:31:36.000+0000", "updated": "2013-12-27T19:04:46.000+0000" }, { "id": "288351", "author": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updateAuthor": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-01-15T22:41:37.000+0000", "updated": "2014-01-15T22:41:37.000+0000" }, { "id": "288429", "author": { "name": "sko", "key": "sko", "displayName": "Matej", "active": true, "timeZone": "America/Los_Angeles" }, "updateAuthor": { "name": "sko", "key": "sko", "displayName": "Matej", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-01-16T09:12:56.000+0000", "updated": "2014-01-16T09:12:56.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }