Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25937] Android: Horizontal TextField scrolling should not be canceled by scrollable parent view

GitHub Issuen/a
TypeImprovement
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2018-04-18T00:25:46.000+0000
Affected Version/sn/a
Fix Version/sRelease 7.3.0
ComponentsAndroid
LabelsScrollView, TextField, android
ReporterJoshua Quick
AssigneeJoshua Quick
Created2018-04-05T21:16:21.000+0000
Updated2018-06-21T22:18:36.000+0000

Description

*Summary:* When a TextField is within a vertical ListView, ScrollView, or TableView... horizontal TextField scrolling will be canceled if you drag your finger too far up/down and the vertically scrolling parent view will steal/intercept all touch events from there. This makes scrolling a TextField difficult. *Expected Behavior:* Once horizontal scrolling has started in a TextField, the parent view should no longer be able to scroll vertically until your finger has been released. *Steps to Reproduce:*

Build/run the below code on Android.

Start dragging a TextField horizontally.

As you drag it horizontally, drag up or down.

Notice that the TextField no longer scrolls horizontally and you're now vertically scrolling the parent ScrollView instead.

var window = Ti.UI.createWindow();
var scrollView = Ti.UI.createScrollView(
{
	showVerticalScrollIndicator: true,
	layout: "vertical",
});
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",
	}));
	row.add(Ti.UI.createTextField(
	{
		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.",
		left: "5dp",
		right: "5dp",
		width: Ti.UI.FILL,
		height: Ti.UI.SIZE,
	}));
	scrollView.add(row);
}
window.add(scrollView);
window.open();
*Notes:* * A vertical scrolling TextArea does not have this problem since it supports "nested" scrolling. * iOS does not allow horizontal scrolling of a TextField at all while in a vertically scrolling parent, but I don't think we should match this behavior on Android since it makes it less convenient to use.

Comments

  1. Joshua Quick 2018-04-06

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/9985
  2. Lokesh Choudhary 2018-04-18

    FR Passed. PR merged.
  3. Lokesh Choudhary 2018-06-21

    Verified the fix in SDK 7.3.0.v20180618182516. Closing.

JSON Source