-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Dialog in Menu #3939
Comments
Could you share the whole code so that I may reproduce this example |
@wassafshahzad I updated the original post to include a much more concise example of this that you should be able to use to reproduce easily. |
@Kastier1 Could you share the link to the original post |
@wassafshahzad #3939 |
Ok thank you, I sorry i misunderstood |
@Kastier1 I think the way you are trying to do it doesn't work, but it's expected. If you set the The way to make it work is to place the class State(rx.State):
dialog_open = False
@rx.page()
def index():
return rx.vstack(
rx.menu.root(
rx.menu.trigger(rx.button("Open Menu")),
rx.menu.content(
rx.menu.item(
rx.text("Dialog"), on_click=State.setvar("dialog_open", True)
),
),
),
rx.dialog.root(
rx.dialog.content(
rx.dialog.title("Dialog"),
rx.text("This is a dialog."),
rx.dialog.close(
rx.button("Close", on_click=State.setvar("dialog_open", False))
),
),
open=State.dialog_open,
),
) |
Describe the bug
A clear and concise description of what the bug is.
When I have a dialog within an menu the dialog will only be open when the menu is open, rendering the dialog unusable.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
The expected behavior is that the menu will close and the dialog will open and be functional
Screenshots
If applicable, add screenshots to help explain your problem.
Screen.Recording.2024-09-16.at.6.11.58.PM.mov
Specifics (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: