-
Notifications
You must be signed in to change notification settings - Fork 594
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Duplicate Check
- I have searched the opened issues and there are no duplicates
Describe the bug
As the title says, when I try to open another AlertDialog by calling page.show_dialog() in an AlertDialog in my project, for the sake of the interface's beauty, I close the previous dialog first and then show the new one. However, I find that this process can easily fail, but it is not necessarily unsuccessful.
Code sample
Code
import flet as ft
class AlertDialogTesting(ft.AlertDialog):
def __init__(
self,
ref: ft.Ref | None = None,
):
super().__init__(
ref=ref,
)
self.title = "AlertDialog Example for Testing"
self.content = ft.Text("Hello, World!")
self.actions = [ft.TextButton("Open New Dialog", on_click=self.open_button_click)]
async def open_button_click(self, event: ft.Event[ft.TextButton]):
self.open = False
self.update()
self.page.show_dialog(AlertDialogTesting()) # will fail randomly
async def main(page: ft.Page):
page.show_dialog(AlertDialogTesting())
if __name__ == "__main__":
ft.run(main)To reproduce
- Run the demo code
- Click "Open New Dialog" button
- There is a probability that you will notice that the dialog box cannot be opened normally
Expected behavior
The new dialog is opened steadily after the old dialog is closed.
Screenshots / Videos
Captures
Flet.2025-10-07.08-26-50.mp4
Operating System
Windows
Operating system details
Windows 11 24H2 (26100.6584)
Flet version
v0.70.0.dev6214
Regression
I'm not sure / I don't know
Suggestions
No response
Logs
Logs
uv run flet run dialog.pyAdditional details
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working