Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List without explicit height only shows first item. #36

Closed
izzmeifter opened this issue Jun 22, 2016 · 2 comments
Closed

List without explicit height only shows first item. #36

izzmeifter opened this issue Jun 22, 2016 · 2 comments
Labels
Milestone

Comments

@izzmeifter
Copy link

izzmeifter commented Jun 22, 2016

Lists that don't explicitly set either a height or layoutData the creates a height will only render the first item until the list is scrolled. If a list also has the verticalScrollPolicy off, the list will never render more than 1 item.

<f:List id="detailsList" verticalScrollPolicy="off" horizontalScrollPolicy="off">
        <f:layoutData>
            <f:AnchorLayoutData left=0" right="0" top="0">
        </f:layoutData>
</f:List>

If you add either bottom="0" or a height property to the list, it will render fine, but in cases of dynamic data used to build a non scrollable list, this doesn't work.

@joshtynjala
Copy link
Member

joshtynjala commented Jun 22, 2016

I can reproduce using the following code:

var group:LayoutGroup = new LayoutGroup();
group.autoSizeMode = AutoSizeMode.STAGE;
group.layout = new AnchorLayout();
this.addChild(group);

var list:List = new List();
list.dataProvider = new ListCollection(
[
]);
list.verticalScrollPolicy = ScrollPolicy.OFF;
list.horizontalScrollPolicy = ScrollPolicy.OFF;
list.layoutData = new AnchorLayoutData(0, 0, NaN, 0);
group.addChild(list);

var button:Button = new Button();
button.label = "Click Me";
button.addEventListener(Event.TRIGGERED, function():void
{
    list.dataProvider.addItem({label: "New Item"});
});
this.addChild(button);

This is probably the same issue as feathersui/feathersui-starling#1394

@joshtynjala joshtynjala added this to the 3.1 milestone Jun 22, 2016
joshtynjala added a commit to feathersui/feathersui-starling that referenced this issue Jun 23, 2016
…resized, such as when new items are added to a List (closes #1394) (references feathersui/feathersui-starling-sdk#36)
joshtynjala added a commit to feathersui/feathersui-starling that referenced this issue Jun 23, 2016
…resized, such as when new items are added to a List (closes #1394) (references feathersui/feathersui-starling-sdk#36)
@joshtynjala
Copy link
Member

This is a regression, and it worked properly in 2.3.0, so I plan to include the fix in a 3.0.2 update. I will probably wait a week or two before releasing it, just in case other issues come up. Thanks for your patience.

joshtynjala added a commit to feathersui/feathersui-starling that referenced this issue Jun 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants