Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25552] Android: Nested scrolling within disabled ScrollView are not propagated to parent

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2018-02-27T19:56:14.000+0000
Affected Version/sRelease 6.2.2
Fix Version/sRelease 7.1.0
ComponentsAndroid
Labelsandroid, scrollview
ReporterJoshua Quick
AssigneeJoshua Quick
Created2017-11-23T01:32:56.000+0000
Updated2018-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.

Comments

  1. Joshua Quick 2017-11-23

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/9625
  2. Joshua Quick 2018-02-15

    PR (7.1.x): https://github.com/appcelerator/titanium_mobile/pull/9835
  3. Lokesh Choudhary 2018-03-06

    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

JSON Source