{ "id": "127603", "key": "TIMOB-16622", "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": "18414", "description": "", "name": "Release 6.2.0", "archived": false, "released": true, "releaseDate": "2017-09-13" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2017-08-10T21:23:35.000+0000", "created": "2014-03-12T21:53:03.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "contentInsets", "extendEdges", "ios", "listview", "navigationWindow", "searchbar", "translucent" ], "versions": [ { "id": "15857", "description": "Release 3.2.2", "name": "Release 3.2.2", "archived": false, "released": true, "releaseDate": "2014-03-09" } ], "issuelinks": [ { "id": "40861", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "120189", "key": "TIMOB-15287", "fields": { "summary": "iOS7: TableView with SearchBar does not respect autoAdjustScrollViewInsets Window property", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "36498", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "128651", "key": "TIMOB-16826", "fields": { "summary": "iOS: ListView under NavigationWindow with extendEdges and autoAdjustScrollViewInsets fails to position properly.", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "priority": { "name": "Medium", "id": "3" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-08-11T18:26:47.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": "The extendEdges property of a window under a NavigationWindow allows the content of the window to extend under a translucent navigation bar, giving an iOS 7 depth effect. \r\n\r\nHowever, when extendEdges is defined and a SearchBar is added to a ListView the positioning is incorrect. Using contentInsets on the ListView should align the SearchBar to be visible under the navigation bar, but it does not work as expected. It also creates a positioning problem when one clicks the SearchBar to use it, as it gets re-positioned under the navigation bar.\r\n\r\nExpected Behavior:\r\n\r\nWhen the SearchBar is added to a ListView, it should show below the navigation bar of the window without the need to use contentInsets. It should also remain in position when the user taps on it to enter some search text.\r\n\r\nTest:\r\n\r\nUsing the code below, load the app. The initial view (pic 1) shows the SearchBar hidden below the navigation bar. \r\n\r\nTapping on the status bar at the top, correctly positions the SearchBar below the navigation bar (pic 2).\r\n\r\nTapping on the search bar to enter text, re-positions the SearchBar again under the navigation bar (pic 3).\r\n\r\napp.js:\r\n{code}\r\nvar rows = [];\r\nfor (var i = 0; i < 50; i++) {\r\n rows.push({ properties: { title: '\\u263B Row '+ i }});\r\n}\r\n\r\n\r\nvar win = Ti.UI.createWindow({\r\n\ttitle: 'TEST',\r\n\textendEdges: [Ti.UI.EXTEND_EDGE_TOP, Ti.UI.EXTEND_EDGE_BOTTOM],\r\n\tbackgroundColor: '#ffffff',\r\n\tnavBarHidden: false\r\n});\r\n\r\nvar nav = Ti.UI.iOS.createNavigationWindow({ window: win });\r\n\r\n\r\nvar sb = Ti.UI.createSearchBar();\r\n\r\n\r\nvar ls = Ti.UI.createListSection({\r\n\titems: rows\r\n});\r\n\r\n\r\nvar lv = Ti.UI.createListView({\r\n \tcontentInsets: { top: 64, bottom: 60 },\r\n sections: [ls],\r\n searchView: sb\r\n});\r\n\r\n\r\nwin.add(lv);\r\nnav.open();\r\n{code}", "attachment": [ { "id": "46598", "filename": "1_init_view.jpg", "author": { "name": "bcproductions", "key": "bcproductions", "displayName": "Ed", "active": true, "timeZone": "America/Havana" }, "created": "2014-03-12T21:53:03.000+0000", "size": 16981, "mimeType": "image/jpeg" }, { "id": "46599", "filename": "2_tap_to_position.jpg", "author": { "name": "bcproductions", "key": "bcproductions", "displayName": "Ed", "active": true, "timeZone": "America/Havana" }, "created": "2014-03-12T21:53:03.000+0000", "size": 17001, "mimeType": "image/jpeg" }, { "id": "46600", "filename": "3_tap_to_search.jpg", "author": { "name": "bcproductions", "key": "bcproductions", "displayName": "Ed", "active": true, "timeZone": "America/Havana" }, "created": "2014-03-12T21:53:03.000+0000", "size": 23934, "mimeType": "image/jpeg" } ], "flagged": false, "summary": "iOS: ListView with SearchBar under NavigationWindow with extendEdges fails to position properly.", "creator": { "name": "bcproductions", "key": "bcproductions", "displayName": "Ed", "active": true, "timeZone": "America/Havana" }, "subtasks": [], "reporter": { "name": "bcproductions", "key": "bcproductions", "displayName": "Ed", "active": true, "timeZone": "America/Havana" }, "environment": "Ti SDK 3.2.2GA, iOS 7.1, Simulator 7.0", "closedSprints": [ { "id": 920, "state": "closed", "name": "2017 Sprint 14 SDK", "startDate": "2017-07-02T16:29:41.455Z", "endDate": "2017-07-16T16:29:00.000Z", "completeDate": "2017-07-17T14:39:47.328Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "296947", "author": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Moving this ticket to engineering as I can reproduce this issue with the provided test case and iOS simulator.", "updateAuthor": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-03-13T05:10:20.000+0000", "updated": "2014-03-13T05:10:20.000+0000" }, { "id": "419873", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Replacement of UISearchDisplayController with UISearchController in TIUIListView\r\nPR: https://github.com/appcelerator/titanium_mobile/pull/9066\r\n\r\nTest Case1 :\r\n{code:java}\r\n// without navigation bar\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 : 100,\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}\r\n\r\nTest Case 2 -\r\n{code:java}\r\n// with navigation bar\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\n \r\n\r\nvar win = Ti.UI.createWindow({\r\n title: 'TEST',\r\n backgroundColor: '#ffffff',\r\n});\r\n \r\nvar nav = Ti.UI.iOS.createNavigationWindow({ \r\n window: win,\r\n });\r\n \r\n var testView = Ti.UI.createView({\r\n backgroundColor : 'green'\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 dimBackgroundForSearch: false,\r\n sections: [ls],\r\n searchView: sb,\r\n});\r\n\r\n testView.add(lv);\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(testView);\r\nnav.open();\r\n{code}\r\n\r\nTest Case 3 -\r\n{code:java}\r\n// With tab bar\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 win1 = 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 : 20,\r\n left : 50,\r\n right : 20,\r\n sections: [ls],\r\n searchView: sb,\r\n resultsBackgroundColor: 'green',\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\nwin1.add(lv);\r\n\r\nvar win2 = Ti.UI.createWindow({\r\n backgroundColor: 'red',\r\n title: 'Red'\r\n});\r\nwin2.add(Ti.UI.createLabel({text: 'I am a red window.'}));\r\n\r\nvar tab1 = Ti.UI.createTab({\r\n window: win1,\r\n title: 'Blue'\r\n}),\r\ntab2 = Ti.UI.createTab({\r\n window: win2,\r\n title: 'Red'\r\n}),\r\ntabGroup = Ti.UI.createTabGroup({\r\n tabs: [tab1, tab2]\r\n});\r\ntabGroup.open();\r\n\r\n{code}\r\n\r\n", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-05-17T09:23:51.000+0000", "updated": "2017-06-20T07:19:37.000+0000" }, { "id": "420002", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "For TIUITableView also the changes has been made in same PR as both were similar changes.\r\n\r\nTest Case for TIUITableView -\r\n\r\nTest Case 1-\r\n{code:java}\r\n// TIUITableView with navigation\r\nvar rows = [];\r\nfor (var i = 0; i < 20; i++) {\r\n rows.push({ title: 'Row '+ i});\r\n}\r\nvar win = Ti.UI.createWindow({\r\n title: 'TEST',\r\n backgroundColor: '#ffffff',\r\n navBarHidden: false\r\n});\r\n \r\nvar nav = Ti.UI.iOS.createNavigationWindow({ \r\n window: win,\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});\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\nwin.add(lv);\r\nnav.open();\r\n{code}\r\n\r\nTest Case 2 - \r\n{code:java}\r\n// TiUITableView without navigation\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 navBarHidden: false\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});\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}\r\n\r\nTest Case 3 - \r\n\r\n\r\n{code:java}\r\n// Tableview with tabbar\r\nvar rows = [];\r\nfor (var i = 0; i < 20; i++) {\r\n rows.push({ title: 'Row '+ i});\r\n}\r\n \r\nvar win1 = Ti.UI.createWindow({\r\n title: 'TEST',\r\n backgroundColor: 'red',\r\n navBarHidden: false\r\n});\r\n \r\nvar sb = Ti.UI.createSearchBar();\r\n \r\nvar lv = Ti.UI.createTableView({\r\n hideSearchOnSelection: false,\r\n dimBackgroundForSearch: true,\r\n data: rows,\r\n search: sb,\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\nwin1.add(lv);\r\n\r\nvar win2 = Ti.UI.createWindow({\r\n backgroundColor: 'red',\r\n title: 'Red'\r\n});\r\nwin2.add(Ti.UI.createLabel({text: 'I am a red window.'}));\r\n\r\nvar tab1 = Ti.UI.createTab({\r\n window: win1,\r\n title: 'Blue'\r\n}),\r\ntab2 = Ti.UI.createTab({\r\n window: win2,\r\n title: 'Red'\r\n}),\r\ntabGroup = Ti.UI.createTabGroup({\r\n tabs: [tab1, tab2]\r\n});\r\ntabGroup.open();\r\n{code}", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-05-19T04:29:58.000+0000", "updated": "2017-06-20T07:20:52.000+0000" }, { "id": "422354", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "In this PR, Replacement of UISearchDisplayController with UISearchController in TIUIListView and TiUITableView has done. There is major change in TiUITableView and TIUIListView especially with search bar. So need more testing.", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-06-20T08:14:08.000+0000", "updated": "2017-06-20T08:15:05.000+0000" }, { "id": "424345", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Test case ( search bar is not part of list view) -\r\n\r\n\r\n{code:java}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: '#fff'\r\n});\r\n \r\nvar list = Ti.UI.createListView({\r\n top: 50,\r\n keepSectionsInSearch: true,\r\n sections: [Ti.UI.createListSection({\r\n headerTitle:\"Line1\",\r\n items: [{\r\n properties: {\r\n title: \"I\",\r\n searchableText: \"I\",\r\n }\r\n },{\r\n properties: {\r\n title: \"Item 2\",\r\n searchableText: \"Item 2\",\r\n }\r\n },{\r\n properties: {\r\n title: \"Item 3\",\r\n searchableText: \"Item 3\",\r\n }\r\n }\r\n ]\r\n }),\r\n Ti.UI.createListSection({\r\n headerTitle:\"Line2\",\r\n\r\n items: [{\r\n properties: {\r\n title: \"I4\",\r\n searchableText: \"I4\",\r\n }\r\n },{\r\n properties: {\r\n title: \"Item 5\",\r\n searchableText: \"Item 5\",\r\n }\r\n },{\r\n properties: {\r\n title: \"Item 6\",\r\n searchableText: \"Item 6\",\r\n }\r\n }\r\n ]\r\n })]\r\n})\r\n \r\n list.addEventListener(\"delete\", function(e){\r\n Ti.API.info(\"Deleted Row Index is is: \" +e.itemIndex);\r\n Ti.API.info(\"Deleted Section Index is is: \" +e.sectionIndex);\r\n\r\n });\r\nvar searchBar = Ti.UI.createSearchBar({\r\n top:0,\r\n height:44,\r\n barColor:'#000',\r\n showCancel:true,\r\n});\r\nsearchBar.addEventListener('change', function(e){\r\nlist.searchText = e.value;\r\n});\r\n\r\nsearchBar.addEventListener('return', function(e){\r\n searchBar.blur();\r\n});\r\n\r\nsearchBar.addEventListener('cancel', function(e){\r\n searchBar.blur();\r\n});\r\n\r\nwin.add(searchBar);\r\nwin.add(list);\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-07-19T02:49:15.000+0000", "updated": "2017-07-19T04:24:01.000+0000" }, { "id": "426438", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Backported PR (6_2_X) : https://github.com/appcelerator/titanium_mobile/pull/9296.\r\n[~hknoechel] Please review. Thanks.", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-08-10T04:40:45.000+0000", "updated": "2017-08-10T04:40:45.000+0000" }, { "id": "426502", "author": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "body": "FR Passed, using:\r\nMacOS 10.12.6 (16G24b)\r\nStudio 4.9.0.201705302345\r\nTi SDK 7.0.0.v20170802103048 & 6.2.0.v20170810132631\r\nAppc NPM 4.2.9\r\nAppc CLI 6.2.3\r\nAlloy 1.9.13\r\nXcode 8.3.3 (8E3004b)\r\n\r\nTested searchbar functionality when used with listview and tableview. No issues encountered. Tested using the provided sample code as well as the searchbar suite", "updateAuthor": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-08-10T21:23:35.000+0000", "updated": "2017-08-10T21:24:03.000+0000" }, { "id": "426570", "author": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Verified changes in 6.2.0.v20170811022027 & 7.0.0.v20170811094808", "updateAuthor": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-08-11T18:26:47.000+0000", "updated": "2017-08-11T18:26:47.000+0000" } ], "maxResults": 13, "total": 13, "startAt": 0 } } }