[TIMOB-25937] Android: Horizontal TextField scrolling should not be canceled by scrollable parent view
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-04-18T00:25:46.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 7.3.0 |
Components | Android |
Labels | ScrollView, TextField, android |
Reporter | Joshua Quick |
Assignee | Joshua Quick |
Created | 2018-04-05T21:16:21.000+0000 |
Updated | 2018-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.
PR (master): https://github.com/appcelerator/titanium_mobile/pull/9985
FR Passed. PR merged.
Verified the fix in SDK 7.3.0.v20180618182516. Closing.