[TIMOB-25491] iOS: Ti.UI.SearchBar not slide down when set visible a view on top
| GitHub Issue | n/a |
| Type | Bug |
| Priority | Critical |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2017-11-28T16:44:01.000+0000 |
| Affected Version/s | Release 6.3.0 |
| Fix Version/s | Release 7.0.0 |
| Components | iOS |
| Labels | ios, iphone |
| Reporter | Michele Cavalcanti |
| Assignee | Vijay Singh |
| Created | 2017-11-08T10:08:58.000+0000 |
| Updated | 2017-11-28T20:30:09.000+0000 |
Description
Hi, I have a SearchBar inside a Listview and when onChange event is fired i want show a View on top of ListView. With sdk 6.3.0 the Searchbar not slide down but with skd 6.1.2 the SearchBar slide down.
I have attach a complete example code.
You can test my code with sdk 6.1.2 and 6.3.0 and you can see different behavior
Attachments
| File | Date | Size |
| bugios.zip | 2017-11-08T09:44:12.000+0000 | 10007525 |
PR : https://github.com/appcelerator/titanium_mobile/pull/9622 Test Case 1 (TiUIListView) -
Test Case 2 (TiUITableView) -var rows = []; for (var i = 0; i < 20; i++) { rows.push({ properties: { title: 'Row '+ i , backgroundColor: 'red', searchableText:'Row '+i}}); } var win = Ti.UI.createWindow({ title: 'TEST', backgroundColor: 'white', layout: 'vertical' }); var sb = Ti.UI.createSearchBar(); var ls = Ti.UI.createListSection({ items: rows }); var lv = Ti.UI.createListView({ sections: [ls], searchView: sb, left: 30, right: 20 }); sb.setHintText("test"); sb.addEventListener('change', function(e){ view.setHeight(50); Ti.API.info(e.value); }); //when the return key is hit, remove focus from our searchBar sb.addEventListener('return', function(e){ view.setHeight(0); sb.blur(); }); sb.addEventListener('cancel', function(e){ view.setHeight(0); }); lv.addEventListener('itemclick', function(e) { Ti.API.info('click at index: ' + e.itemIndex); }); var view = Ti.UI.createView({ backgroundColor : 'blue', height : 0, }); view.addEventListener('click', function(e){ Ti.API.info('view clicked'); }); win.add(view); win.add(lv); win.open();Test Case 3 (Offset in ListView):var rows = []; for (var i = 0; i < 10; i++) { rows.push({ title: 'Row '+ i}); } var win = Ti.UI.createWindow({ backgroundColor: 'red', layout : 'vertical' }); var sb = Ti.UI.createSearchBar(); var lv = Ti.UI.createTableView({ data: rows, search: sb, top : 50, left : 30 }); sb.setHintText("test"); sb.addEventListener('change', function(e){ Ti.API.info(e.value); view.setHeight(50); }); sb.addEventListener('return', function(e){ sb.blur(); view.setHeight(0); }); sb.addEventListener('cancel', function(e){ view.setHeight(0); }); lv.addEventListener('click', function(e) { Ti.API.info('click at index: ' + e.index); Ti.API.info('clicked row data: ' + e.rowData.title); }) var view = Ti.UI.createView({ backgroundColor : 'blue', height : 0, }); view.addEventListener('click', function(e){ Ti.API.info('view clicked'); }); win.add(view); win.add(lv); win.open();var rows = []; for (var i = 0; i < 20; i++) { rows.push({ properties: { title: 'Row '+ i , backgroundColor: 'red', searchableText:'Row '+i}}); } var win = Ti.UI.createWindow({ backgroundColor: 'white' }); var sb = Ti.UI.createSearchBar(); var ls = Ti.UI.createListSection({ items: rows }); var lv = Ti.UI.createListView({ sections: [ls], searchView: sb, top: 100, left: 30, right: 20 }); sb.addEventListener('change', function(e){ Ti.API.info(e.value); }); // when the return key is hit, remove focus from our searchBar sb.addEventListener('return', function(e){ sb.blur(); }); lv.addEventListener('itemclick', function(e) { Ti.API.info('click at index: ' + e.itemIndex); }); win.add(lv); win.open();This ticket fix the issue TIMOB-25528 and TIMOB-25532 as well. So we have to verify test cases mentioned in tickets TIMOB-25528 and TIMOB-25532.
FR passed, PR merged.
Verified in SDK build 7.0.0.v20171128115332