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

state-var in menu trigger blocks display of menu content #4573

Open
coproc opened this issue Dec 26, 2024 · 1 comment
Open

state-var in menu trigger blocks display of menu content #4573

coproc opened this issue Dec 26, 2024 · 1 comment

Comments

@coproc
Copy link

coproc commented Dec 26, 2024

Describe the bug
When using a state var for the text of a menu trigger, clicking on it does not display the menu content

To Reproduce
Steps to reproduce the behavior:

"""minimal example showing that state-vars in menu-trigger block display of menu-content"""

import reflex as rx
from rxconfig import config

class State(rx.State):
	text:str = "my state-var text"

def index() -> rx.Component:
	return rx.hstack(
		rx.menu.root(
			rx.menu.trigger(rx.button("my text")),
			rx.menu.content(rx.menu.item("my menu content")) # is shown
		),
		rx.menu.root(
			rx.menu.trigger(rx.button(State.text)),   # shown, but blocks content
			rx.menu.content(rx.menu.item("my menu content")), # not shown
		),
	)

app = rx.App()
app.add_page(index)

Expected behavior
Clicking on the button [my state-var text] should show the menu content (like it works when clicking on the button [my text]).

Screenshots
grafik

Specifics (please complete the following information):

  • Python Version: 3.12.6
  • Reflex Version: 0.6.7
  • OS: Windows 10
  • Browser (Optional): Firefox
Copy link

linear bot commented Dec 26, 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

1 participant