Skip to content

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

Description

@coproc

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions