-
-
Notifications
You must be signed in to change notification settings - Fork 629
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
ui.dialog
hidden when created inside a ui.menu
#4116
Comments
Thanks for reporting this issue, @tgbl-mk! See #4092 (comment) for an explanation what is going on. Since this behavior confuses quite some users, we should do something about it. Maybe we should always nest dialogs in the top-level page content, and not somewhere inside child elements. To prevent breaking changes, we could introduce a parameter |
Thanks for the quick response @falkoschindler! After reviewing the link I can understanding whats happening a bit better. Creating the dialog within the context of ui.context.client.content fixes the issue for me so I'm happy to close this issue out. The addition of a an additional parameter to ui.dialog sounds like a sensible future solution to me. |
ui.dialog
hidden when created inside a ui.menu
I was just about to implement the new parameter, but noticed a problem with this approach: Currently you can create a dialog within Therefore I tend to look for a different solution. |
We're still unsure how to avoid this unexpected behavior. Maybe |
Description
I am trying to use ui.menu and ui.menu_item to create a dropdown menu (think file menu in most applications). If i try and create a dialog window from the function called by on_click, then I get an unexpected response when clicking the menu item.
This enough code to reproduce the issue:
If you click a menu item that has auto_close set to False then the dialog opens as expected. However if you click a menu item with auto_close set to True(the default value), "click" is printed to the terminal and the menu closes without opening the dialog. If you reopen the menu then the dialog will then open. I have attached a video showing the behaviour below.
Screen.Recording.2024-12-17.123227.mp4
It seems that the dialog will only be displayed whilst the menu is open.
Is this expected behaviour? An acceptable solution for me would be to leave the menu open while the dialog is displayed, and to close the menu when the dialog is closed. I suspect this is already possible with the existing methods.
I am using python 3.11.0 and nicegui 2.8.1 have attached the requirements.txt from my .venv below
requirements.txt
Please let me know if any additional information is required! Thanks
The text was updated successfully, but these errors were encountered: