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

get_directory_path issue #1562

Closed
markosster opened this issue Jul 7, 2023 · 4 comments
Closed

get_directory_path issue #1562

markosster opened this issue Jul 7, 2023 · 4 comments

Comments

@markosster
Copy link

Function get_directory_path closes application's window after on_click event. Specifically after the dialog window closes it freezes the app for about 2-3 seconds and then terminates the application.

Code:

Test example from: #1297

Mainly i found this on my code and i tried to test it for clearness with this simple example and it came out that it does not work on it either, so i post the simple one bellow.

import flet as ft


def main(page: ft.Page):
    page.theme_mode = "light"

    def result(e):
        page.add(ft.Text("result :)"))

    my_dialog = ft.FilePicker(on_result=result)

    page.overlay.append(my_dialog)

    page.add(
        ft.Row(
            [
                ft.ElevatedButton("Pick", icon=ft.icons.UPLOAD_FILE,
                                  on_click=lambda _: my_dialog.pick_files()),
                ft.ElevatedButton("Save", icon=ft.icons.UPLOAD_FILE,
                                  on_click=lambda _: my_dialog.save_file()),
                ft.ElevatedButton("Get Dir", icon=ft.icons.UPLOAD_FILE,
                                  on_click=lambda _: my_dialog.get_directory_path()),
            ]
        )
    )


ft.app(target=main)

Results:

  • In the above example will print the text message from the result function, but after it will close the app.

Additional information:

  • pick_files and save_file works fine.

Flet version:

Name: flet
Version: 0.8.0

Operating system:

  • Windows 11
@hokaso
Copy link
Contributor

hokaso commented Jul 8, 2023

It is indeed this error. The problem I found is exactly as you described. Thank you very much for your report. https://github.com/flet-dev/flet/issues/1563

@hokaso
Copy link
Contributor

hokaso commented Jul 20, 2023

@markosster Is this problem solved?

@markosster
Copy link
Author

@hokaso Yes. I tested it with the latest version of flet (0.8.2) and it doesnt crash.

@slashfast
Copy link

@hokaso Yes. I tested it with the latest version of flet (0.8.2) and it doesnt crash.

I have this issue still present in flet==0.8.2 on Windows 11, however on macOS Ventura everything works correctly.

FeodorFitsner added a commit that referenced this issue Jul 24, 2023
zrr1999 pushed a commit to zrr1999/flet that referenced this issue Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants