Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26167] Android: Cannot edit TextField/TextArea while in a ScrollView as of 7.3.0

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2018-07-03T12:07:42.000+0000
Affected Version/sRelease 7.3.0
Fix Version/sRelease 7.3.0
ComponentsAndroid
LabelsScrollView, TextArea, TextField, android, regression
ReporterAhmed Mohamed
AssigneeJoshua Quick
Created2018-06-28T18:59:46.000+0000
Updated2018-07-03T21:47:20.000+0000

Description

*Summary:* As of Titanium 7.3.0 (not released yet), Android's TextField/TextArea view cannot be edited while they're in a ScrollView. When tapping on them, they immediately drop the focus. This is not an issue in Titanium 7.2.0. I've confirmed it. *Steps to reproduce:*

Create a classic app with the below code targeting Titanium 7.3.0.

Build and run on Android.

Tap on a TextArea.

Notice that the virtual keyboard does not appear. You are unable to edit it.

Scroll down to the bottom.

Tap on a TextField.

Notice that the virtual keyboard does not appear. You are unable to edit it.

var window = Ti.UI.createWindow();
var scrollView = Ti.UI.createScrollView({
	showVerticalScrollIndicator: true,
	layout: "vertical",
	width: Ti.UI.FILL,
	height: Ti.UI.FILL,
});
for (var index = 1; index <= 20; index++) {
	var row = Ti.UI.createView({
		layout: "horizontal",
		width: Ti.UI.FILL,
		height: Ti.UI.SIZE,
	});
	row.add(Ti.UI.createLabel({
		text: "Row " + index.toString(),
		left: "5dp",
	}));
	var fieldCreator = (index <= 10) ? Ti.UI.createTextArea : Ti.UI.createTextField;
	row.add(fieldCreator({
		value: "Welcome to the Appcelerator Platform! The Appcelerator Platform helps you develop cross-platform mobile applications using the Titanium SDK, Alloy, Appcelerator Studio and the Appcelerator CLI, then lets you manage the entire lifecycle of the application with debugging, testing, deploying, crash monitoring and analytic data collection.",
		hintText: "Hint Text",
		hintType: Ti.UI.HINT_TYPE_ANIMATED,
		left: "5dp",
		right: "5dp",
		width: Ti.UI.FILL,
		height: (fieldCreator == Ti.UI.createTextArea) ? "100dp" : Ti.UI.SIZE,
	}));
	scrollView.add(row);
}
window.add(scrollView);
window.open();

Comments

  1. Hans Knöchel 2018-06-28

    Is this SDK 7.3+ only? cc [~jquick]
  2. Joshua Quick 2018-06-28

    Oh bummer. Yes, I'm able to reproduce this issue. It happens to TextFields and TextAreas. I've confirmed that this is only an issue in 7.3.0, which is not released yet. It's not an issue in 7.2.0. A 7.3.0 PR must of broken it. I'll hunt it down.
  3. Joshua Quick 2018-06-29

    I've confirmed that the following PR has caused the regression... https://github.com/appcelerator/titanium_mobile/pull/9901 [~ybanev], we're going to have to find an alternate solution for [TIMOB-25819]. The FOCUS_BLOCK_DESCENDANTS setting is preventing TextFields and TextAreas from receiving the focus, which prevents them from being edited.
  4. Joshua Quick 2018-06-29

    I have a solution that solves this ticket's issue and solves [TIMOB-25819] as well. I'll submit the PR tomorrow. [~ahmed.mohamed20320], thanks for reporting this issue.
  5. Joshua Quick 2018-06-30

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/10145
  6. Joshua Quick 2018-07-02

    PR (7.3.x): https://github.com/appcelerator/titanium_mobile/pull/10149
  7. Lokesh Choudhary 2018-07-03

    Verified the fix with SDK 7.3.0.v20180703051211. Closing. Studio Ver: 5.1.0.201806291005 SDK Ver: 7.3.0.v20180703051211 OS Ver: 4.2.13 Xcode Ver: 7.0.4 Appc NPM: 1.1.3 Appc CLI: 10.13.5 Daemon Ver: Xcode 9.4.1 Ti CLI Ver: 5.1.1 Alloy Ver: 1.12.0 Node Ver: 8.9.1 NPM Ver: 5.5.1 Java Ver: 10.0.1 Devices: ⇨ google Nexus 5 --- Android 6.0.1 ⇨ google Nexus 6P --- Android 8.1.0 Emulator: ⇨ Android 4.1.2

JSON Source