Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ft.SnackBar sets behavior=ft.SnackBarBehavior.FLOATING, no floating effect #3311

Closed
ixuuux opened this issue May 17, 2024 · 4 comments · Fixed by #3313
Closed

ft.SnackBar sets behavior=ft.SnackBarBehavior.FLOATING, no floating effect #3311

ixuuux opened this issue May 17, 2024 · 4 comments · Fixed by #3313
Assignees
Labels
bug: regression A feature that worked correctly doesn't anymore

Comments

@ixuuux
Copy link

ixuuux commented May 17, 2024

Description

Use behavior=ft.SnackBarBehavior.FLOATING in ft.SnackBar

In 0.22.1, There is no floating effect, it seems to be glued to the right side.
In 0.20.2, works fine.
They use the same code.

image

Code example to reproduce the issue:

import flet as ft


def main(page: ft.Page):
    page.window_width = 500
    page.window_height = 500
    page.window_center()

    page.snack_bar = ft.SnackBar(
        content=ft.Text(f"Hello, world!"),
        behavior=ft.SnackBarBehavior.FLOATING,
        width=200,
    )

    def show_snack_bar(e):
        page.snack_bar.open = True
        page.snack_bar.duration = 30 * 1000
        page.update()

    page.add(
        ft.FilledTonalButton(f'Show SnackBar', on_click=show_snack_bar),
        ft.Text(value=f'{ft.__name__} {ft.version.version}', style=ft.TextStyle(size=30, color=ft.colors.RED))
    )
    page.update()


if __name__ == '__main__':
    ft.app(main)

Flet version (pip show flet):

Name: flet
Version: 0.22.1
Summary: Flet for Python - easily build interactive multi-platform apps in Python
Home-page:
Author: Appveyor Systems Inc.
Author-email: hello@flet.dev
License: Apache-2.0
Location: c:\users\...\lib\site-packages
Requires: cookiecutter, fastapi, flet-runtime, packaging, qrcode, uvicorn, watchdog
Required-by:

Operating system:
Windows10

Additional environment details:
python 3.8.10

@ndonkoHenri
Copy link
Collaborator

What did you expect?

@ixuuux
Copy link
Author

ixuuux commented May 17, 2024

@ndonkoHenri This is what I want. (Pay attention to the position of the SnackBar message at the bottom)

image

@ixuuux
Copy link
Author

ixuuux commented May 17, 2024

@ndonkoHenri I updated this issues, please take a look.

@ixuuux ixuuux changed the title behavior parameter of ft.SnackBar not working as expected ft.SnackBar sets behavior=ft.SnackBarBehavior.FLOATING, no floating effect May 17, 2024
@ndonkoHenri ndonkoHenri added the bug: regression A feature that worked correctly doesn't anymore label May 17, 2024
@ndonkoHenri
Copy link
Collaborator

Thanks! Working on the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: regression A feature that worked correctly doesn't anymore
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants