{ "id": "102783", "key": "TIMOB-11285", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "14613", "description": "Release 2.1.4", "name": "Release 2.1.4", "archived": true, "released": true, "releaseDate": "2012-11-12" }, { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" }, { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" }, { "id": "14165", "description": "2012 Sprint 21 API", "name": "2012 Sprint 21 API", "archived": true, "released": true, "releaseDate": "2012-10-22" }, { "id": "14273", "description": "2012 Sprint 21", "name": "2012 Sprint 21", "archived": true, "released": true, "releaseDate": "2012-10-22" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-10-18T22:10:10.000+0000", "created": "2012-10-06T00:15:47.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "SupportTeam", "api", "qe-port", "regression" ], "versions": [ { "id": "14137", "description": "Release 2.1.3", "name": "Release 2.1.3", "archived": true, "released": true, "releaseDate": "2012-10-03" } ], "issuelinks": [], "assignee": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2012-11-01T19:02:35.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": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "h4. Problem \r\nIf you execute blur and then open a window, looks like the blur never happened. If you run an example with Kitchensink, the blur will work as expected. It's like there is a race condition between the execution of the blur in the textfield and the open of the window, where the window opening will take precedence. \r\n\r\n\r\nh4. Actual Results\r\nThe textfield never gets the blur command, when followed by a window opening. \r\n\r\nh4. Expected results\r\nThe textfield should blur, then the window should open. \r\n\r\nh4. Test case \r\n1. Copy this code to an app.js:\r\n{code}\r\n// this sets the background color of the master UIView (when there are no windows/tab groups on it)\r\nTitanium.UI.setBackgroundColor('#000');\r\n\r\n// create tab group\r\nvar tabGroup = Titanium.UI.createTabGroup();\r\n\r\n//\r\n// create base UI tab and root window\r\n//\r\nvar win1 = Titanium.UI.createWindow({\r\n\ttitle : 'Win 1',\r\n\tbackgroundColor : '#fff'\r\n});\r\nvar productTF1 = Ti.UI.createTextField({\r\n\tborderStyle : Ti.UI.INPUT_BORDERSTYLE_ROUNDED,\r\n\ttop : 100,\r\n\twidth : 250,\r\n\theight : 40,\r\n\thintText : \"Add Product...\"\r\n});\r\nproductTF1.addEventListener(\"focus\", function() {\r\n\tTi.API.info(\"focus\");\r\n\tproductTF1.blur();\r\n\tvar win2 = Titanium.UI.createWindow({\r\n\t\ttitle : 'Win 2',\r\n\t\tbackgroundColor : '#fff'\r\n\t});\r\n\tvar close_bttn = Titanium.UI.createButton({\r\n\t\ttitle : \"Close\",\r\n\t\ttop : 10\r\n\t});\r\n\tclose_bttn.addEventListener('click', function() {\r\n\t\tproductTF1.blur();\r\n\t\twin2.close();\r\n\t});\r\n\twin2.add(close_bttn);\r\n\tvar data = [];\r\n\tvar tableView = Ti.UI.createTableView({\r\n\t\tdata : data,\r\n\t\ttop : 100\r\n\t});\r\n\twin2.add(tableView);\r\n\ttab1.open(win2);\r\n});\r\nwin1.add(productTF1);\r\n\r\nvar tab1 = Titanium.UI.createTab({\r\n\ticon : 'KS_nav_views.png',\r\n\ttitle : 'Tab 1',\r\n\twindow : win1\r\n});\r\ntabGroup.addTab(tab1);\r\n\r\n// open tab group\r\ntabGroup.open();\r\n{code}\r\n2. Now run the code with 2.1.3.GA on iOS 4.x. \r\n3. If you click on the textfield, the window will open. Close the window, the textfield shouldn't be focused. \r\n\r\nh4. Extra info.\r\nThis is a regression. This used to work just fine with TiSDK 2.1.3.v20120915120319, now with 2.1.3.GA is broken. ", "attachment": [], "flagged": false, "summary": "iOS: Textfield.blur is having a strange race condition when blurring a textfield and then opening a window", "creator": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "subtasks": [], "reporter": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "environment": "Titanium SDK version: 2.1.3 GA \r\nPlatform & version: iOS 4.3\r\nDevice Details: iOS simulator / iphone\r\nHost Operating System: OSX 10.7.3 \r\nTitanium Studio version: 2.1.2", "closedSprints": [ { "id": 3, "state": "closed", "name": "Release 3.0.0", "startDate": "2012-09-27T05:26:46.636Z", "endDate": "2012-10-08T20:05:00.000Z", "completeDate": "2012-12-20T17:03:19.403Z" } ], "comment": { "comments": [ { "id": "222782", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Note backport request to 2_1_X branch.", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-10-09T21:33:10.000+0000", "updated": "2012-10-09T21:33:10.000+0000" }, { "id": "222795", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Wait, what? They're trying to blur in the midle of a focus event? Why even have the text field in the first place? How is this even a valid use case?", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-10-09T22:15:11.000+0000", "updated": "2012-10-09T22:15:11.000+0000" }, { "id": "223010", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "body": "Hello,\nI'm talking with the customer, so I can provide a workaround onto this. \n\nBEst,\nMauro ", "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2012-10-10T23:34:20.000+0000", "updated": "2012-10-10T23:34:20.000+0000" }, { "id": "223017", "author": { "name": "gavinharriss", "key": "gavinharriss", "displayName": "Gavin Harriss", "active": true, "timeZone": "Pacific/Auckland" }, "body": "I wonder if this is related to the issue I'm having: TC-1362", "updateAuthor": { "name": "gavinharriss", "key": "gavinharriss", "displayName": "Gavin Harriss", "active": true, "timeZone": "Pacific/Auckland" }, "created": "2012-10-10T23:55:51.000+0000", "updated": "2012-10-10T23:55:51.000+0000" }, { "id": "223159", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Not related to TC-1362. This is a race condition issue. ", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-10-11T20:37:06.000+0000", "updated": "2012-10-11T20:37:06.000+0000" }, { "id": "224224", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "There is a behavior difference in the platform. The developer should never have to call blur when opening a new window.\nTest Case below.\n\n1. Set inTab to true and notice that returning to previous window brings up the keyboards\n2. Set inTab to false and notice that the keyboard remains hidden.\n\n{code}\n// this sets the background color of the master UIView (when there are no windows/tab groups on it)\nTitanium.UI.setBackgroundColor('#000');\nvar opened = false; \nvar inTab = false;\n// create tab group\nvar tabGroup = Titanium.UI.createTabGroup();\n \n//\n// create base UI tab and root window\n//\nvar win1 = Titanium.UI.createWindow({\n    title : 'Win 1',\n    backgroundColor : '#fff'\n});\nvar productTF1 = Ti.UI.createTextField({\n    borderStyle : Ti.UI.INPUT_BORDERSTYLE_ROUNDED,\n    top : 100,\n    width : 250,\n    height : 40,\n    hintText : \"Add Product...\"\n});\nproductTF1.addEventListener(\"focus\", function() {\n    Ti.API.info(\"focus\");\n\tif (opened == true) {\n\t\treturn;\n\t}\n\topened = true;\n    var win2 = Titanium.UI.createWindow({\n        title : 'Win 2',\n        backgroundColor : '#fff'\n    });\n    var close_bttn = Titanium.UI.createButton({\n        title : \"Close\",\n        top : 10\n    });\n    close_bttn.addEventListener('click', function() {\n        win2.close();\n    });\n    win2.add(close_bttn);\n    var data = [];\n    var tableView = Ti.UI.createTableView({\n        data : data,\n        top : 100\n    });\n    win2.add(tableView);\n\tif (inTab == true) {\n\t    tab1.open(win2);\n\t}\n\telse {\n\t\twin2.open();\n\t}\n});\nwin1.add(productTF1);\n \nvar tab1 = Titanium.UI.createTab({\n    icon : 'KS_nav_views.png',\n    title : 'Tab 1',\n    window : win1\n});\ntabGroup.addTab(tab1);\n \n// open tab group\ntabGroup.open();\n{code}", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-10-18T17:56:26.000+0000", "updated": "2012-10-18T17:56:26.000+0000" }, { "id": "224226", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Pull pending https://github.com/appcelerator/titanium_mobile/pull/3285", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-10-18T17:59:18.000+0000", "updated": "2012-10-18T17:59:18.000+0000" }, { "id": "224334", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "3_0_X backport https://github.com/appcelerator/titanium_mobile/pull/3292\n2_1_X backport https://github.com/appcelerator/titanium_mobile/pull/3293", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-10-18T22:16:38.000+0000", "updated": "2012-10-18T22:16:38.000+0000" }, { "id": "225822", "author": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested with 2.1.4.v20121030173408 on iPhone 4s 6.0", "updateAuthor": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-11-01T18:34:40.000+0000", "updated": "2012-11-01T18:34:40.000+0000" } ], "maxResults": 13, "total": 13, "startAt": 0 } } }