Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-7609

Android: Searchbar gets the focus when inside the tableview showing keyboard by default

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Invalid
    • Affects Version/s: Release 1.8.0.1, Release 2.0.0, Release 1.8.2, Release 2.1.1
    • Component/s: Android
    • Labels:
    • Environment:

      android 2.3.4
      Samsung Galaxy SII
      Motorola DROID (old)
      Google Nexus Tablet 7

      Description

      Description

      When window opens, it immediately focuses to the searchbar inside tableview showing keyboard by default. This behavior is experienced in some devices only. I experienced it in Samsung Galaxy SII. The keyboard doesn't show up by default in Motorola DROID (old). This happens only in some devices,it runs perfectly in the emulator

      This is happening in Google Nexus Tablet 7 (with AndroidOS 4.1).

      Repo Steps

      1. Run the below code.
      2. You can see the keyboard appears by default immediately when the window opens.

      var win = Ti.UI.createWindow({backgroundColor: '#000000'});
       
      var search = Titanium.UI.createSearchBar({
      	barColor:'#000',
      	showCancel:true,
      	height:43,
      	top:0
      });
       
      // create table view data object
      var data = [
      	{title:'Row 1', hasChild:true, color:'red', selectedColor:'#fff'},
      	{title:'Row 2', hasDetail:true, color:'green', selectedColor:'#fff'},
      	{title:'Row 3', hasCheck:true, color:'blue', selectedColor:'#fff'},
      	{title:'Row 4', color:'orange', selectedColor:'#fff'},
      	{title:'Row 5'},
      	{title:'Row 6'},
      	{title:'Row 7'},
      	{title:'Row 8'},
      	{title:'Row 9'},
      	{title:'Row 10'},
      	{title:'Row 11'},
      ];
       
      // create table view
      var tableview = Titanium.UI.createTableView({
      	data:data,
      	search:search 
      });
       
      // add table view to the window
      win.add(tableview);
       
      win.addEventListener('focus', function(e) {
      	search.blur();
      });
       
      win.open();
      

        Attachments

          Activity

            People

            • Assignee:
              hpham Hieu Pham
              Reporter:
              nsharma Nikhil Sharma
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-12067
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Integration