Skip to content

FlexBox does not respect height argument and does not provide scroll argument #7422

Open
@MarcSkovMadsen

Description

@MarcSkovMadsen

panel==1.5.2

In #7411 I'm trying to make it easier to "pick" examples for your model and data app. You will be able to select and example via a Button. Those buttons might ideally be layed out in a FlexBox to utilize the available width and the height you give it.

But its not possible as the height is not respected and there is no scroll parameter.

Reproducible Example

import panel as pn

pn.extension()

examples = [pn.widgets.Button(name=f"Beat Boxing {index}") for index in range(0,1000)]
pn.Column("Above", pn.FlexBox(*examples, height=500), "Below").servable()

image

It would be nice if all ListPanel layouts (Column, Row, FlexBox and more) where as close to drop in replacements for each other as possible.

Workaround

Put the FlexBox inside a Column. Set the height and scroll on the Column.

import panel as pn

pn.extension()

examples = [pn.widgets.Button(name=f"Beat Boxing {index}") for index in range(0,1000)]
pn.Column("Above", pn.Column(pn.FlexBox(*examples), height=500, scroll=True), "Below").servable()

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions