Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-18903] Android: Text entry for TextField within ListView not working correctly with Android 5.0

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2015-06-17T02:45:21.000+0000
Affected Version/sn/a
Fix Version/sRelease 4.1.0
ComponentsAndroid
Labelslistview, textfield
ReporterPhilippe Wueger
AssigneeHieu Pham
Created2015-03-30T08:39:23.000+0000
Updated2015-06-18T21:52:46.000+0000

Description

Comments

  1. Philippe Wueger 2015-04-08

    Any update on this? Seems like a rather major issue to me. Thanks.
  2. Christian Waldmann 2015-05-12

    This happens on Android 5.1 too. Is there any progress or priority on this? This really blocks my development!
  3. Christian Waldmann 2015-06-11

    Reproduced on OnePlus One with 5.0.2
  4. Ingo Muschenetz 2015-06-12

    FYI, cc [~hpham]
  5. Hieu Pham 2015-06-16

    master PR: https://github.com/appcelerator/titanium_mobile/pull/6915 additional testing code (KS needs to be tested as well):
       function setupTest(win) {
       	
       	var data0 = [
       	{template:'myCell1',taskLabel:{text:'Name'}},
       	{template:'myCell1',taskLabel:{text:'Number'}}];
       
       	var myTemplate1 = {
       		properties: {height: '50dp'},
       		childTemplates:[
       		{
       			type:'Ti.UI.Label',
       			bindId:'taskLabel',
       			properties:{ left:0,width:'50%'}
       		},
       		{
       			type:'Ti.UI.TextField',
       			properties:{ right:0, width:'50%', borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED, color:'black', backgroundColor:'lightgray',value:''},
       		}
       		]
       	};
       
       	var section0 = Ti.UI.createListSection({headerTitle:'DATA ENTRY'});
       	section0.setItems(data0);
       
       
       	var listView = Ti.UI.createListView({
       		templates:{'myCell1':myTemplate1},
       		sections:[section0]
       	});
       	
       	
       	win.add(listView);
       }
       
       	var softInput = 'none';
       	if (Titanium.Platform.osname == 'android') {
       		softInput = Ti.UI.Android.SOFT_INPUT_ADJUST_PAN;
       	}
       	var win = Ti.UI.createWindow({
       		title:'Update Items',
       		windowSoftInputMode:softInput
       	});
       	
       	setupTest(win);
       	
       	win.open();
       
  6. Ashraf Abu 2015-06-17

    To get the earlier sample code working:-
       var softInput = 'none';
       if (Titanium.Platform.osname == 'android') {
       	softInput = Ti.UI.Android.SOFT_INPUT_ADJUST_PAN;
       }
       
       var template = {
       	childTemplates : [{// Title
       		type : 'Titanium.UI.TextField', // Use a label for the title
       		bindId : 'info', // Maps to a custom info property of the item data
       		properties : {// Sets the label properties
       			color : 'black',
       			height : 50,
       			left : 10,
       			keyboardType : Titanium.UI.KEYBOARD_DEFAULT,
       			width : 300,
       		}
        
       	}]
       };
       var section = Ti.UI.createListSection();
       var sectionData = [];
        
       for (var k = 0; k < 15; k++) {
       	sectionData.push({
       		info : {
       			hintText : 'Row ' + (k + 1)
       		}
       	});
       }
       section.setItems(sectionData);
        
       var listView = Ti.UI.createListView({
       	sections : [section],
       	separatorColor:'blue',
       	templates : {
       		'template' : template
       	},
       	defaultItemTemplate : 'template',
       	top : 20,
        
       });
        
       var win = Ti.UI.createWindow({
       	title : 'ListView',
       	backgroundColor : '#fff',
       	windowSoftInputMode:softInput
       });
       win.add(listView);
       win.open();
       
       
  7. Lokesh Choudhary 2015-06-18

    Verified the fix. Entering text in to a textfield within a listview now works as expected. Closing. Environment: Appc Studio : 4.1.0.201506151224 Ti SDK : 4.1.0.v20150617152826 Ti CLI : 4.0.1 Alloy : 1.6.2 MAC Yosemite : 10.10.3 Appc NPM : 4.1.0-1 Appc CLI : 4.1.0-1 Node: v0.10.37 Nexus 5 - Android 5.1.1

JSON Source