Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26577] Windows: ScrollView sizing incorrectly in a vertical layout

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2018-12-10T12:09:25.000+0000
Affected Version/sRelease 7.5.0
Fix Version/sRelease 8.0.0
ComponentsWindows
Labelsn/a
ReporterChristopher Williams
AssigneeKota Iguchi
Created2018-11-16T19:30:25.000+0000
Updated2018-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();

Comments

  1. Kota Iguchi 2018-12-03

    https://github.com/appcelerator/titanium_mobile_windows/pull/1328
  2. Josh Longton 2018-12-10

    *FR Passed*
  3. Samir Mohammed 2018-12-11

    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

JSON Source