Skip to content

bug: V1: GridView and ListView with horizontal=True shows blank screen if height is not set #5555

@InesaFitsner

Description

@InesaFitsner

Duplicate Check

Describe the bug

If expand or height is set, it works with horizontal=True; otherwise shows grey/blank screen.

Code sample

Code
import flet as ft

logging.basicConfig(level=logging.DEBUG)


def main(page: ft.Page):
    page.title = "GridView Example"
    page.theme_mode = ft.ThemeMode.LIGHT
    page.update()

    page.add(
        ft.GridView(
            horizontal=True,
            # expand=1,
            max_extent=150,
            controls=[
                ft.Container(ft.Text("Item 1"), bgcolor=ft.Colors.AMBER),
                ft.Container(ft.Text("Item 2"), bgcolor=ft.Colors.AMBER),
                ft.Container(ft.Text("Item 3"), bgcolor=ft.Colors.AMBER),
            ],
        ),
    )

    page.update()


ft.run(main)

To reproduce

  1. Run repro code
  2. You will not see the GridView, just blank screen

Expected behavior

No response

Screenshots / Videos

Captures

[Upload media here]

Operating System

macOS

Operating system details

macOs

Flet version

0.69.0

Regression

I'm not sure / I don't know

Suggestions

No response

Logs

Logs
[Paste your logs here]

Additional details

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions