[TIMOB-26577] Windows: ScrollView sizing incorrectly in a vertical layout
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Medium |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2018-12-10T12:09:25.000+0000 |
| Affected Version/s | Release 7.5.0 |
| Fix Version/s | Release 8.0.0 |
| Components | Windows |
| Labels | n/a |
| Reporter | Christopher Williams |
| Assignee | Kota Iguchi |
| Created | 2018-11-16T19:30:25.000+0000 |
| Updated | 2018-12-11T12:43:03.000+0000 |
Description
In our unit tests suite, the ti.ui.layout.test.js scrollViewWithSIZE test is failing on Windows with expected 24 to equal 50
https://github.com/appcelerator/titanium-mobile-mocha-suite/blob/master/Resources/ti.ui.layout.test.js#L1291
The test is now skipped on Windows.
It turns out this only happens when parent view is
vertical layout.
As a side note, postlayout for ScrollView may be fired multiple times during layout and we should be testing latest value only.
var scrollView = Ti.UI.createScrollView({
height: Ti.UI.SIZE,
width: Ti.UI.SIZE,
backgroundColor: 'red'
});
var view1 = Ti.UI.createButton({
width: '100',
height: '50',
title: 'Click',
backgroundColor: 'pink'
});
scrollView.add(view1);
scrollView.addEventListener('postlayout', function () {
Ti.API.info(JSON.stringify(scrollView.size));
});
var win = Ti.UI.createWindow({
backgroundColor: 'white',
layout: 'vertical'
});
win.add(scrollView);
win.open();
https://github.com/appcelerator/titanium_mobile_windows/pull/1328
*FR Passed*
Closing ticket, fix verified in SDK version 8.0.0.v20181210172243. Test and other information can be found at: https://github.com/appcelerator/titanium_mobile_windows/pull/1328