Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Overflow auto bug after adding members to layout

    In v10.0d I notice a small but annoying bug with overflow auto.

    Here is an example to demonstrate: I create 3 HStacks with overflow auto and 2 ListGrids as members.

    The first HStack has no problem since members are added inline during HStack declaration.

    However the second HStack has 2 identical ListGrids added dynamically after HStack creation using setMembers and for some reason it show a vertical scrollbar and the grids' heights are inaccurate - bigger than they should be.

    Interestingly the third HStack also had members added dynamically but overflow was set to "scroll" and the heights of grids are accurate.

    I also added a button to resize second HStack to make it smaller at which point the vertical scrollbar disappears and grids' heights are adjusted properly

    Code:
    var listGrids = [];
    for(var i=0; i<6; i++){
    	listGrids[i] = isc["ListGrid"].create({
    		autoFitData: "horizontal",
    		fields: [{},{},{}]
    	});
    }
    var hStack1 = isc["HStack"].create({
    		width:300,
    		overflow: "auto",
    		height: 150,
    		members:[listGrids[0], listGrids[1]]
    	}),
    	hStack2 = isc["HStack"].create({
    		left: 310,
    		width:300,
    		height: 150,
    		overflow: "auto"
    	}),
    	hStack3 = isc["HStack"].create({
    		left: 620,
    		width:300,
    		height: 150,
    		overflow: "scroll"
    	});
    hStack2.setMembers([listGrids[2], listGrids[3]]);
    hStack3.setMembers([listGrids[4], listGrids[5]]);
    isc["Button"].create({
    	left: 310,
    	top: 160,
    	width: 300,
    	height: 50,
    	title: "Resize second HStack to make it smaller<br>Vertical scrollbar will go away",
    	click: function(){
    		hStack2.setHeight(120);
    	}
    });
Working...
X