[TIMOB-28504] Android: ScrollableView "views" property not returning what was assigned during creation before window open as of 10.0.1
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2021-07-19T15:28:02.000+0000 |
Affected Version/s | Release 10.0.1 |
Fix Version/s | Release 10.0.1 |
Components | Android |
Labels | ScrollableView, android, regression |
Reporter | Joshua Quick |
Assignee | Joshua Quick |
Created | 2021-07-07T01:53:34.000+0000 |
Updated | 2021-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].
PR (master): https://github.com/appcelerator/titanium_mobile/pull/12942