{ "id": "169791", "key": "TIMOB-25287", "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": "19906", "description": "", "name": "Release 6.3.0", "archived": false, "released": true, "releaseDate": "2017-11-01" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2017-10-11T21:23:54.000+0000", "created": "2017-09-15T09:45:35.000+0000", "epic": { "id": 169755, "key": "TIMOB-25267", "name": "iOS: Add support for iPhone X", "summary": "iOS: Add support for iPhone X", "color": { "key": "color_5" }, "done": false }, "priority": { "name": "High", "id": "2" }, "labels": [ "iphonex" ], "versions": [ { "id": "18414", "description": "", "name": "Release 6.2.0", "archived": false, "released": true, "releaseDate": "2017-09-13" } ], "issuelinks": [ { "id": "55964", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "169759", "key": "TIMOB-25271", "fields": { "summary": "iPhone X: Validate Layout changes", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false } } } } ], "assignee": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-11-01T10:28:27.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": "While looking in TIMOB-25271, I found that when search started in list view in iPhone X, search bar get placed at wrong position. \r\n\r\n\r\nTest Case-\r\n\r\n\r\n{code:java}\r\nvar rows = [];\r\nfor (var i = 0; i < 20; i++) {\r\n rows.push({ properties: { title: 'Row '+ i , backgroundColor: 'red', searchableText:'Row '+i}});\r\n}\r\nvar win = Ti.UI.createWindow({\r\n title: 'TEST',\r\n backgroundColor: '#ffffff',\r\n}); \r\nvar sb = Ti.UI.createSearchBar();\r\n \r\nvar ls = Ti.UI.createListSection({\r\n items: rows\r\n});\r\n \r\n var lv = Ti.UI.createListView({\r\n top : 0,\r\n sections: [ls],\r\n searchView: sb,\r\n resultsBackgroundColor: 'green',\r\n resultsSeparatorColor: 'blue'\r\n});\r\n \r\nsb.setHintText(\"test\");\r\n sb.addEventListener('change', function(e){\r\n Ti.API.info(e.value);\r\n});\r\n \r\n //when the return key is hit, remove focus from our searchBar\r\nsb.addEventListener('return', function(e){\r\n sb.blur();\r\n});\r\nlv.addEventListener('itemclick', function(e) {\r\n Ti.API.info('click at index: ' + e.itemIndex);\r\n});\r\n \r\nwin.add(lv);\r\nwin.open();\r\n{code}", "attachment": [ { "id": "63279", "filename": "screenshot_iphoneX.png", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-09-16T08:13:43.000+0000", "size": 78856, "mimeType": "image/png" } ], "flagged": false, "summary": "iPhone X: Ti.UI.SearchBar in list-view get wrongly positioned", "creator": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "427933", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Can you attach a screenshot?\r\n\r\n*EDIT*: Thanks! Also see [this post|https://www.bignerdranch.com/blog/get-your-apps-ready-for-iphone-x/] that talks about the search-bar as well. The fix would basically be:\r\n{code:objc}\r\nif ([TiUtils isiOS11OrLater]) {\r\n self.navigationItem.searchController = searchController;\r\n searchController.isActive = YES;\r\n} else {\r\n // Old behavior\r\n}\r\n{code}", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-09-15T11:46:13.000+0000", "updated": "2017-09-16T18:59:29.000+0000" }, { "id": "427966", "author": { "name": "mdelmarter", "key": "mdelmarter", "displayName": "Matthew Delmarter", "active": true, "timeZone": "Pacific/Auckland" }, "body": "A couple of other interesting links in relation to issues with the searchBar in iOS 11. \r\n\r\nThe actual size of the searchBar has changed. It seems you might be able to control it:\r\nhttps://stackoverflow.com/questions/46037928/ios-11-uisearchbar-in-navigation-bar\r\n\r\nAnd then when the searchBar is needed in the navigationBar then as Hans mentioned in the previous comment, you need to use the new searchController option. This link has a nice screenshot of the problem etc:\r\nhttps://stackoverflow.com/questions/45350035/ios-11-searchbar-in-navigationbar", "updateAuthor": { "name": "mdelmarter", "key": "mdelmarter", "displayName": "Matthew Delmarter", "active": true, "timeZone": "Pacific/Auckland" }, "created": "2017-09-16T20:36:56.000+0000", "updated": "2017-09-16T20:36:56.000+0000" }, { "id": "427968", "author": { "name": "mdelmarter", "key": "mdelmarter", "displayName": "Matthew Delmarter", "active": true, "timeZone": "Pacific/Auckland" }, "updateAuthor": { "name": "mdelmarter", "key": "mdelmarter", "displayName": "Matthew Delmarter", "active": true, "timeZone": "Pacific/Auckland" }, "created": "2017-09-16T21:44:58.000+0000", "updated": "2017-09-16T21:44:58.000+0000" }, { "id": "428515", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/9483\r\nPR (6_3_X): https://github.com/appcelerator/titanium_mobile/pull/9482\r\n\r\nTest Case - \r\n1 . \r\n{code:java}\r\nvar rows = [];\r\nfor (var i = 0; i < 20; i++) {\r\n rows.push({ properties: { title: 'Row '+ i , backgroundColor: 'red', searchableText:'Row '+i}});\r\n}\r\nvar win = Ti.UI.createWindow({\r\n title: 'TEST',\r\n backgroundColor: '#ffffff',\r\n}); \r\nvar sb = Ti.UI.createSearchBar();\r\n \r\nvar ls = Ti.UI.createListSection({\r\n items: rows\r\n});\r\n var lv = Ti.UI.createListView({\r\n sections: [ls],\r\n searchView: sb,\r\n});\r\n \r\nsb.setHintText(\"test\");\r\n sb.addEventListener('change', function(e){\r\n Ti.API.info(e.value);\r\n});\r\n //when the return key is hit, remove focus from our searchBar\r\nsb.addEventListener('return', function(e){\r\n sb.blur();\r\n});\r\nlv.addEventListener('itemclick', function(e) {\r\n Ti.API.info('click at index: ' + e.itemIndex);\r\n});\r\nwin.add(lv);\r\nvar navWin = Ti.UI.iOS.createNavigationWindow({window: win});\r\nnavWin.open();\r\n{code}\r\n\r\n2. \r\n{code:java}\r\nvar rows = [];\r\nfor (var i = 0; i < 20; i++) {\r\n rows.push({ properties: { title: 'Row '+ i , backgroundColor: 'red', searchableText:'Row '+i}});\r\n}\r\nvar win = Ti.UI.createWindow({\r\n title: 'TEST',\r\n backgroundColor: '#ffffff',\r\n}); \r\nvar sb = Ti.UI.createSearchBar();\r\n \r\nvar ls = Ti.UI.createListSection({\r\n items: rows\r\n});\r\n \r\n var lv = Ti.UI.createListView({\r\n sections: [ls],\r\n searchView: sb,\r\n top:100\r\n});\r\nsb.setHintText(\"test\");\r\n sb.addEventListener('change', function(e){\r\n Ti.API.info(e.value);\r\n});\r\n //when the return key is hit, remove focus from our searchBar\r\nsb.addEventListener('return', function(e){\r\n sb.blur();\r\n});\r\nlv.addEventListener('itemclick', function(e) {\r\n Ti.API.info('click at index: ' + e.itemIndex);\r\n});\r\n \r\nwin.add(lv);\r\nwin.open();\r\n{code}\r\n\r\n3. TiUITableView\r\n\r\n{code:java}\r\nvar rows = [];\r\nfor (var i = 0; i < 20; i++) {\r\n rows.push({ title: 'Row '+ i});\r\n}\r\n \r\n \r\nvar win = Ti.UI.createWindow({\r\n title: 'TEST',\r\n backgroundColor: '#ffffff',\r\n});\r\n \r\nvar sb = Ti.UI.createSearchBar();\r\n \r\nvar lv = Ti.UI.createTableView({\r\n hideSearchOnSelection: false,\r\n data: rows,\r\n search: sb,\r\n top:50\r\n});\r\n \r\n sb.setHintText(\"test\");\r\n sb.addEventListener('change', function(e){\r\n Ti.API.info(e.value);\r\n});\r\n \r\n //when the return key is hit, remove focus from our searchBar\r\nsb.addEventListener('return', function(e){\r\nsb.blur();\r\n});\r\n \r\n//when the cancel button is tapped, remove focus from our searchBar\r\nsb.addEventListener('cancel', function(e){\r\n//sb.blur();\r\n});\r\nlv.addEventListener('click', function(e) {\r\n Ti.API.info('click at index: ' + e.index);\r\n Ti.API.info('clicked row data: ' + e.rowData.title);\r\n \r\n})\r\n \r\nwin.add(lv);\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-09-27T09:03:49.000+0000", "updated": "2017-09-27T09:26:52.000+0000" }, { "id": "428968", "author": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "body": "FR Passed. Searchbar displays in the correct position on iPhone X. Tested using the provided cases in this and the related ticket that the PR is for as well as the searchbar suite", "updateAuthor": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-10-11T21:23:54.000+0000", "updated": "2017-10-11T21:23:54.000+0000" }, { "id": "428980", "author": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Verified in SDK builds 6.3.0.v20171011142527 & 7.0.0.v20171009065347", "updateAuthor": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-10-11T23:07:41.000+0000", "updated": "2017-10-11T23:07:41.000+0000" }, { "id": "443167", "author": { "name": "mdelmarter", "key": "mdelmarter", "displayName": "Matthew Delmarter", "active": true, "timeZone": "Pacific/Auckland" }, "body": "Did the new searchController referred to by @Hans ever get implemented?\r\n\r\nHe talked about...\r\n\r\n{code}\r\nif ([TiUtils isiOS11OrLater]) {\r\n self.navigationItem.searchController = searchController;\r\n searchController.isActive = YES;\r\n} else {\r\n // Old behavior\r\n}\r\n{code}", "updateAuthor": { "name": "mdelmarter", "key": "mdelmarter", "displayName": "Matthew Delmarter", "active": true, "timeZone": "Pacific/Auckland" }, "created": "2018-11-01T03:53:26.000+0000", "updated": "2018-11-01T03:53:26.000+0000" }, { "id": "443176", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "I don't think so far! I just created a new ticket (TIMOB-26509) to track this. We need this as well, thanks for the hint!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-11-01T10:28:27.000+0000", "updated": "2018-11-01T10:28:27.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }