flet-dev / flet

Flet enables developers to easily build realtime web, mobile and desktop apps in Python. No frontend experience required.
https://flet.dev
Apache License 2.0
10.75k stars 416 forks source link

Floating Action Button Location (FloatingActionButtonLocation) dont't work in v0.23 #3485

Closed azhago closed 2 months ago

azhago commented 2 months ago

Duplicate Check

Describe the bug

Hi, Just upgraded in v0.23: floating_action_button_location param in page or view do not work anymore, floating ction button are always at bottom right of the page/view.

Code


def main(page: ft.Page) -> None:

    floating_button = ft.FloatingActionButton(
        icon=ft.icons.ADD,
        tooltip="Add",
        on_click=lambda _: print("Floating action button clicked"),
    )

    page.add(ft.Text("Floating action button location"))
    page.add(ft.Text("V23"))

    page.window_width = 500
    page.window_height = 500
    page.vertical_alignment = ft.MainAxisAlignment.START
    page.horizontal_alignment = ft.CrossAxisAlignment.START

    page.floating_action_button = floating_button
    page.floating_action_button_location = ft.FloatingActionButtonLocation.START_FLOAT
    page.update()

    print(page._get_attr("floatingActionButtonLocation"))

if __name__ == "__main__":
    ft.app(target=main)

To reproduce

Run the previous code in v0.23.0

Expected behavior

No response

Screenshots

v0.23.0 image same code with v0.22.1 image

Operating System

Windows

Operating system details

windows 11

Flet version

0.23.0

Regression

Yes, it used to work in a previous Flet version (please specify the version in additional details)

Suggestions

No response

Additional details

No response

ndonkoHenri commented 2 months ago

I get this with Flet v0.23.0: image

azhago commented 2 months ago

I think it's platform dependant. I recreate a brand new venv and install flet from scratch:

azhago commented 2 months ago

Wow, so fast! Thanks for your great work 👍