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

Android: Textfield loses focus and tableView scrolls to top when entering text into textfield and pickers are part of tableViewRows

    Details

    • Type: Bug
    • Status: Reopened
    • Priority: Low
    • Resolution: Unresolved
    • Affects Version/s: Release 3.2.0
    • Fix Version/s: None
    • Component/s: Android
    • Environment:

      Ti SDK 1.8.2
      Android 4.0.3 (Tested In Emulator)
      Titanium Studio, build: 2.0.2.201204191742
      Mac OS X 10.7

      Description

      When pickers are present in other tableViewRows, an attempt to enter text into a textField results in one character being entered into the field just before the textField loses focus and the tableView scrolls to its top.

      Without pickers present in other rows, the behavior is as expected and the user can continue to enter text.

      Sample code:

      var win =Ti.UI.createWindow({backgroundColor:'#fff'});
       
      var captions = [];
      var fields = [];
      var rows = [];
      var pickerRows = [];
       
      for (var i = 0, ii=20; i<ii; i++){
      	if(i%2==0){
      		fields[i] = Ti.UI.createTextField({
      			value:'field ' + i + ' contents',
      			width:200,
      			height:60,
      			rowIndex:i
      		});
      	} else {
      		fields[i] = Ti.UI.createPicker({
      			type: Titanium.UI.PICKER_TYPE_PLAIN,
      			selectionIndicator:true,
      			width:200
      		});
       
      		if(i%5 == 0){
      			fields[i].type = Titanium.UI.PICKER_TYPE_DATE;
      		} else {
      			for (var x = 0, xx = i; x<xx; x++){
      				pickerRows[x] = Ti.UI.createPickerRow({
      					title:'row ' + x,
      					value:x
      				});
      			}
      			fields[i].add(pickerRows);		
      		}
      	}
       
      	captions[i] = Ti.UI.createLabel({
      		text:'This is caption ' + i,
      		width:200,
      		height:60
      	});
      	
       	rows[i] = Ti.UI.createTableViewRow({layout:'vertical'});
       
       	rows[i].add(captions[i]);
       	rows[i].add(fields[i]);
      }
       
      var tableView = Ti.UI.createTableView(
      	{
      		data:rows
      	}
      );
       
      win.add(tableView);
       
      win.open();
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              dzr Da'oud Rashid
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:

                Backbone Issue Sync

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

                  Git Source Code