[TIMOB-25552] Android: Nested scrolling within disabled ScrollView are not propagated to parent
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-02-27T19:56:14.000+0000 |
Affected Version/s | Release 6.2.2 |
Fix Version/s | Release 7.1.0 |
Components | Android |
Labels | android, scrollview |
Reporter | Joshua Quick |
Assignee | Joshua Quick |
Created | 2017-11-23T01:32:56.000+0000 |
Updated | 2018-03-06T23:41:01.000+0000 |
Description
*Summary:*
When scrolling a child view within a ScrollView, once you reach the top or bottom of the child view, the drag event is supposed to scroll the parent ScrollView. And if the parent ScrollView reaches its top or bottom, then it's drag event is supposed to be propagated to the ScrollView's parent, in case there is a ScrollView within a ScrollView. This works fine unless the inner ScrollView's "scrollingDisabled" is set false, in which case, the nested drag event is no longer bubbled up the UI tree.
*Steps to reproduce:*
Build and run the below code on an Android device.
Scroll one of the TextArea fields up and down past the bounds of its scrollable area.
var window = Ti.UI.createWindow();
var rootScrollView = Ti.UI.createScrollView(
{
layout: "vertical",
scrollType: "vertical",
showHorizontalScrollIndicator: false,
shorVerticalScrollIndicator: true,
width: Ti.UI.FILL,
height: Ti.UI.FILL,
});
for (var index = 1; index <= 20; index++) {
var innerScrollView = Ti.UI.createScrollView(
{
layout: "vertical",
scrollType: "vertical",
showHorizontalScrollIndicator: false,
shorVerticalScrollIndicator: true,
scrollingEnabled: false,
borderColor: "white",
borderWidth: "2dp",
top: "10dp",
left: "5dp",
bottom: "10dp",
right: "5dp",
width: Ti.UI.FILL,
height: Ti.UI.SIZE,
});
innerScrollView.add(Ti.UI.createLabel(
{
text: "Inner Disabled ScollView " + index,
bottom: "5dp",
}));
innerScrollView.add(Ti.UI.createTextArea(
{
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.",
width: Ti.UI.FILL,
height: "100dp",
}));
rootScrollView.add(innerScrollView);
}
window.add(rootScrollView);
window.open();
*Result:*
The outer ScrollView does not scroll when you reach the top or bottom bounds of TextArea's scroll area. (This works fine if "ScrollView.scrollEnabled" property is set true.)
*Expected Result:*
Outer ScrollView should scroll.
PR (master): https://github.com/appcelerator/titanium_mobile/pull/9625
PR (7.1.x): https://github.com/appcelerator/titanium_mobile/pull/9835
Verified the fix in SDK 7.2.0.v20180305152636 & 7.1.0.v20180306061214. Closing. Studio Ver: 5.0.0.201712081732 OS Ver: 10.13.2 Xcode Ver: Xcode 9.2 Appc NPM: 4.2.12 Appc CLI: 7.0.2 Daemon Ver: 1.0.1 Ti CLI Ver: 5.0.14 Alloy Ver: 1.11.0 Node Ver: 8.9.1 NPM Ver: 5.5.1 Java Ver: 1.8.0_101 Devices: ⇨ google Nexus 5 — Android 6.0.1 ⇨ google Nexus 6P — Android 8.0.0