Describe the bug
A clear and concise description of what the bug is.
On click of the menu_trigger _on_open_change sets the value of the ClientStateVar to undefined instead of True
Is this a bug or am I just using call_function incorrectly with set_value?
To Reproduce
Steps to reproduce the behavior:
import reflex as rx
from reflex.event import EventSpec
from reflex.experimental import ClientStateVar
loading = ClientStateVar.create(default=False)
def index() -> rx.Component:
def _on_open_change(is_open: rx.Var[bool]) -> list[EventSpec]:
return [
rx.call_function(loading.set_value(is_open)),
]
return rx.el.div(
rx.text(loading.value.to_string()),
rx.menu.root(
rx.menu.trigger(rx.button("open")),
rx.menu.content(rx.text("hello :)")),
on_open_change=_on_open_change,
),
)
app = rx.App()
app.add_page(index)
Expected behavior
A clear and concise description of what you expected to happen.
_on_open_change sets the ClientStateVar to is_open.
Screenshots
If applicable, add screenshots to help explain your problem.
Specifics (please complete the following information):
- Python Version: 1.14.6
- Reflex Version: 0.9.6
- OS: Linux
- Browser (Optional): Chromium
Additional context
Add any other context about the problem here.
Describe the bug
A clear and concise description of what the bug is.
On click of the menu_trigger _on_open_change sets the value of the ClientStateVar to undefined instead of True
Is this a bug or am I just using call_function incorrectly with set_value?
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
_on_open_change sets the ClientStateVar to is_open.
Screenshots
If applicable, add screenshots to help explain your problem.
Specifics (please complete the following information):
Additional context
Add any other context about the problem here.