Skip to content

[Android][ListView] Wrapping items take up the height of the whole container #9069

@quietbits

Description

@quietbits

It seems like after the update (0.29 or 0.30, not 100% sure which one, but it worked on 0.28) items in a ListView that wrap, take up the height of the whole container. The more items are wrapping, the longer is their height, so I assume it's taking up the container height. There is nothing special in styling or structure there. Just a ListView with item template passed in.

Container styling to make items wrap. If they don't wrap, the height is fine.
<ListView contentContainerStyle={{ flexDirection: 'row', flexWrap: 'wrap' }} renderRow={ (item) => (<ItemTemplate item={item} />) } />

If flexWrap is set to 'wrap' and there are not enough items to wrap (all fit on one line), the height of the items is fine.

When items wrap:
Item height wrong

When items don't wrap:
Item height correct

The only fix for this right now is to set a fixed height to the item. Not ideal, but it works for now. Is anyone having this issue? Maybe you have found a better fix?

React Native: 0.30.0
OS: Mac

Metadata

Metadata

Assignees

No one assigned

    Labels

    Ran CommandsOne of our bots successfully processed a command.Resolution: LockedThis issue was locked by the bot.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions