flet icon indicating copy to clipboard operation
flet copied to clipboard

ExpansionTile control: initially_expanded flag doesn't work

Open yunguangli opened this issue 1 year ago • 1 comments

Description While using the ExpansionTile control, I notice the initially_expanded flag has no effect. Sometime the Tile is always closed initally. In another program, the tile is always initially expanded, no matter how you set the initially_expanded flag.

Code example to reproduce the issue: The code is taken from the example in the documentation.


import flet as ft

def main(page: ft.Page):
    page.spacing = 0
    page.theme_mode = ft.ThemeMode.LIGHT
    page.padding = ft.padding.only(top=0)

    page.add(
       
        ft.ExpansionTile(
            title=ft.Text("ExpansionTile 3"),
            subtitle=ft.Text("Leading expansion arrow icon"),
            affinity=ft.TileAffinity.LEADING,
            initially_expanded=False,
            collapsed_text_color=ft.colors.BLUE,
            text_color=ft.colors.BLUE,
            controls=[
                ft.ListTile(title=ft.Text("This is sub-tile number 3")),
                ft.ListTile(title=ft.Text("This is sub-tile number 4")),
                ft.ListTile(title=ft.Text("This is sub-tile number 5")),
            ],
        ),
    )


ft.app(target=main)

Describe the results you received:

Describe the results you expected:

Additional information you deem important (e.g. issue happens only occasionally):

Flet version (pip show flet):

0.21.1

Give your requirements.txt file (don't pip freeze, instead give direct packages):

(The requirements)

Operating system: Windows 11 Python 3.12.1

Additional environment details:

yunguangli avatar Mar 09 '24 13:03 yunguangli

Thanks for reporting! Fixing this...

ndonkoHenri avatar Mar 09 '24 15:03 ndonkoHenri

A pre-release with the fix concerning this issue is now available. Try it and report if you face any further issues or have any questions:

pip install flet --pre

ndonkoHenri avatar Apr 01 '24 22:04 ndonkoHenri