Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25532] iOS: ListView - controller.open doesn't come to front when using searchbar

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionDuplicate
Resolution Date2017-11-27T08:44:27.000+0000
Affected Version/sRelease 6.3.0
Fix Version/sRelease 7.0.0
ComponentsiOS
LabelssearchBar
Reporterdbenhenni
AssigneeVijay Singh
Created2017-11-17T18:21:21.000+0000
Updated2017-11-28T20:31:43.000+0000

Description

Steps to Reproduce

Inside of my ListView I have an onItemclick event which opens a new detailcontroller. After updating to 4.10.0 the detailcontroller doesn't come to front when using the search before. It appears hidden in the back. Just after canceling the search the detail controller appears.

Actual Result

controller.open() -> controller is hidden by searchbar

Expected Result

controller.open() should come to front.

Attachments

FileDateSize
.log2017-11-17T18:21:42.000+00008899951
diagnostic4660596753765271736.log2017-11-17T18:21:55.000+0000352382

Comments

  1. Sharif AbuDarda 2017-11-17

    Hello, Please share the full reproducible sample code. Also, SDK CLI and testing platform info. Thanks.
  2. dbenhenni 2017-11-18

    Axway Appcelerator Studio, build: 4.10.0.201709271713 Testing Platform: iPad 2 Mini A1490 iOS 10.3.2 SDK: Tested with 6.2.1, 6.2.2 and latest 6.3.0 --> with 6.2.1 and 6.2.2 the searchbar appears on absolutely top of the controller when getting focus. Also in 6.2.2. In 6.3.0 this behaviour disappeared and it stays on correct position but, as I mentioned before, the searchbar on focus stays focused in front, the onItemclick Event is executed and the controller is opened but is hidden by the searchbar unless I click cancel at the searchbar. I will upload an example
  3. dbenhenni 2017-11-18

    Sample View:
       <Alloy>
       	<Window id="win1" layout="absolute">
       		<View id="view1" layout="vertical" height="Ti.UI.FILL" width="Ti.UI.FILL" top="25">
       			<View height="36" top="10" left="10" right="10" layout="absolute" width="Ti.UI.FILL">
       				<Button icon="fa-chevron-left" title=" Close" left="0" ...></Button>
       				
       				<View layout="horizontal" left="28%" width="Ti.UI.FILL">
       					...
       				</View>
       				<Button title=" Refresh" icon="fa-refresh" right="0"  ...></Button>	
       			</View>
       			
       			<ListView id="listview" defaultItemTemplate="template" onItemclick="openItem" left="1%" right="1%" top="5">
       				<SearchBar id="search" showCancel="true" backgroundColor="white" barColor="white"></SearchBar>
       				<Templates>
       ....
       
    View Controller:
       function openItem(e) {
       	try {
       		var item = $.listview.sections[e.sectionIndex].getItemAt(e.itemIndex);
       		var unid = item.properties.c_unid;
       		if (!unid) {
       			log.exception("Doc not found!");
       			return;
       		} else {
       			var arg = { id: unid };
       			var detail = Alloy.createController("tickets/show_item", arg).getView();
       			detail.open();			
       		}
       	} catch(e) {
       		log.exception("openItem",e);
       		return;
       	}
       }
       
  4. Sharif AbuDarda 2017-11-18

    Hello, This is not the full sample code. Please provide a sample app of full reproducible code that we can directly use. Thanks.
  5. dbenhenni 2017-11-20

    Hi, I've created a sample app. How can I provide you the zipped file?
  6. Vijay Singh 2017-11-21

    [~dbenhenni] Is it not possible for you to attach in ticket ?
  7. dbenhenni 2017-11-21

    No, I can't attach a file to the ticket. I'm just seeing - Create Zephyr Test - Stop watching and - Remote Copy
  8. Vijay Singh 2017-11-21

    [~sdarda] Can you help in getting test app from [~dbenhenni]. Thanks!
  9. Hans Knöchel 2017-11-22

    [~vijaysingh] Can you validate this ticket as part of TIMOB-25491? [~dbenhenni] Should be fine to just link it via Dropbox / Google Drive!
  10. Vijay Singh 2017-11-23

    [~dbenhenni] In app.js file of attached example code , I do not see anything related ListView or SearchBar. I think you attached wrong example code. Can you please check it. Thanks!
  11. dbenhenni 2017-11-23

    You are right. This is the correct source code: [Example Code](https://www.dropbox.com/s/kt1ndhnzqu5v870/example_code.zip?dl=0)
  12. Vijay Singh 2017-11-23

    Thanks [~dbenhenni]. We will look in this. Test Case 1 -
        var rows = [];
        for (var i = 0; i < 20; i++) {
            rows.push({ title: 'Row '+ i});
        }
         
         
        var win = Ti.UI.createWindow({
          backgroundColor: '#ffffff',
          extendSafeArea : false
        });
         
         var button = Titanium.UI.createButton({
            title: 'Close Window',
        });
         
        win.add(button);
         
        var win2 = Titanium.UI.createWindow({
          backgroundColor: 'blue'
        });
         
        var sb = Ti.UI.createSearchBar();
         
        var lv = Ti.UI.createTableView({
            hideSearchOnSelection: false,
            data: rows,
            search: sb,
        });
         sb.setHintText("test");
          
        win2.add(button);
         
        lv.addEventListener('click', function(e) {
            Ti.API.info('click at index: ' + e.index); 
            win2.open();
        })
         
         button.addEventListener('click', function(){
          win2.close();
        });
        win.add(lv);
        win.open();
        
    Test Case 2 -
        
        var win1 = Titanium.UI.createWindow({
            backgroundColor: 'red',
            title: 'Red Window',
            extendSafeArea : false
        });
         
        var win2 = Titanium.UI.createWindow({
          backgroundColor : 'blue'
        });
         
         var button = Titanium.UI.createButton({
            title: 'Close Window',
        });
        var rows = [];
        for (var i = 0; i < 5; i++) {
            rows.push({ properties: { title: 'Row '+ i , backgroundColor: 'red', searchableText:'Row '+i}});
        }
         
        var sb = Ti.UI.createSearchBar();
        var ls = Ti.UI.createListSection({
          items: rows
        });
         
         var lv = Ti.UI.createListView({
            top : 0,
            sections: [ls],
            searchView: sb,
        });
         
        sb.addEventListener('return', function(e){
          sb.blur();
        });
        lv.addEventListener('itemclick', function(e) {
            Ti.API.info('click at index: ' + e.itemIndex);
            win2.open();
        }); 
        win2.add(button);
        
        win1.add(lv);
         
        button.addEventListener('click', function(){
          win2.close();
        });
        
        win1.open();
        
  13. Vijay Singh 2017-11-27

    Fixed as part of TIMOB-25491.
  14. Eric Wieber 2017-11-28

    Closing as duplicate and fix verified in SDK build 7.0.0.v20171128115332

JSON Source