Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8332] Android: tableView textField focus is lost while typing

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionWon't Fix
Resolution Date2012-04-27T11:01:29.000+0000
Affected Version/sRelease 1.8.0.1, Release 2.0.0, Release 1.8.2
Fix Version/sn/a
ComponentsAndroid
LabelsSupportTeam, api
ReporterFederico Casali
AssigneeJosh Roesslein
Created2012-03-27T13:14:58.000+0000
Updated2017-08-16T01:05:07.000+0000

Description

Problem description

TableView textField loses focus when typing in.

Steps to reproduce

Create a tableView and a tableViewRow with a textField. Click on the textField and start typing some text Result: after the first character, focus on the textField is lost.
var win = Ti.UI.createWindow({
	backgroundColor:'black'
});

var data = [];

var tableview;
var row = Ti.UI.createTableViewRow({
	clickName: 'row'
});

var textfield = Titanium.UI.createTextField({
	width: '80%',
	height: 80,
	color: '#000',
	returnKeyType: Titanium.UI.RETURNKEY_DONE,
	enableReturnKey: true,
	keyboardType: Titanium.UI.KEYBOARD_ASCII,
	autocorrect: false,
	hintText: 'Enter text Field',
	textAlign: 'left',
	clearOnEdit: false,
	borderStyle: Titanium.UI.INPUT_BORDERSTYLE_ROUNDED,
	clearButtonMode: Titanium.UI.INPUT_BUTTONMODE_ONFOCUS,
	leftButtonMode: Titanium.UI.INPUT_BUTTONMODE_ALWAYS
});

textfield.font = {
	fontSize: '15sp',
	fontFamily: 'Arial'
};
textfield.autocorrect = true;
textfield.borderStyle = Titanium.UI.INPUT_BORDERSTYLE_NONE;

row.add(textfield);

data = [row];
tableview = Titanium.UI.createTableView({
	data: data,
	rowBackgroundColor: 'white',

});
win.add(tableview);

win.open();

Additional notes

Ticket associated: http://support-admin.appcelerator.com/display/APP-682796

Comments

  1. Josh Roesslein 2012-04-17

  2. Josh Roesslein 2012-04-17

    TIMOB-3451 appears to be fixed as well and is probably a duplicate of this issue. Please test to verify.
  3. Josh Roesslein 2012-04-18

    A possible workaround would be to use [SOFT_INPUT_ADJUST_PAN](http://docs.appcelerator.com/titanium/2.0/index.html#!/api/Titanium.UI.Android-property-SOFT_INPUT_ADJUST_PAN) mode when creating the window. This will prevent a resize of the window when the keyboard appears. Focus will be lost if a resize occurs and it is not clear yet if we can fully fix this in platform. We will continue investigating before coming to a final conclusion.
  4. Josh Roesslein 2012-04-27

    After evaluating this issue we have decided not to support placing textfield/textarea inside a table row on Android. It is not well supported and considered bad practice on Android. Please see TIMOB-8869 for a possible alternative path.
  5. Josh Roesslein 2012-04-27

    See TIMOB-8869 for a possible work around.
  6. Josh Roesslein 2012-04-27

    On Android using TextField or TextArea inside a TableViewRow is not well supported and considered bad practice.
  7. Ygor Lemos 2013-10-14

    Is there any docs stating that TextFields inside TableViews (List Views) are a bad practice on Android? I can understand that TextAreas are indeed a bad practice inside Lists as they are both scrolling views, but I see no reason at all that TextFields should be considered bad practice inside any kind of scroll views. Google itself does use textfield inside scrollable views and native List Views (TableViews) on many of their apps.
  8. Lee Morris 2017-08-16

    Closing due to inactivity. If this issue still exists, please raise a new ticket.

JSON Source