Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-28504] Android: ScrollableView "views" property not returning what was assigned during creation before window open as of 10.0.1

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2021-07-19T15:28:02.000+0000
Affected Version/sRelease 10.0.1
Fix Version/sRelease 10.0.1
ComponentsAndroid
LabelsScrollableView, android, regression
ReporterJoshua Quick
AssigneeJoshua Quick
Created2021-07-07T01:53:34.000+0000
Updated2021-07-19T15:28:02.000+0000

Description

*Summary:* Reading the ScrollableView object's "views" property does not return what was assigned to it during creation before the window is opened. The returned array is wrongly empty. This property won't return expected array until after the window opens. This bug was introduced in Titanium 10.0.1 and was caught before release. *Steps to reproduce:*

Build and run the below on Android.

Notice in the log "@@@ view.length" wrongly returns 0.

const window = Ti.UI.createWindow();
const scrollableView = Ti.UI.createScrollableView({
	views: [
		Ti.UI.createLabel({ text: "Page 1" }),
		Ti.UI.createLabel({ text: "Page 2" }),
		Ti.UI.createLabel({ text: "Page 3" }),
	],
	showPagingControl: true,
});
console.log(@@@ views.length: ${scrollableView.views.length}); // uh-oh
window.add(scrollableView);
window.open();
*Note:* This is a regression caused by [TIMOB-28459].

Comments

  1. Joshua Quick 2021-07-07

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/12942

JSON Source