Calling set_focus fails when the autofocus property is set to true for the input element. #2342
Closed
jackychou1119
started this conversation in
General
Replies: 1 comment 1 reply
-
This is a bug because the <Input id={`input_2`} ref={ref_input_2} type={`text`} ref={focusRef} /> So the As a workaround, you might try removing the def mytest() -> rx.Component:
return rx.container(
rx.vstack(
rx.input(
id="input_1",
),
rx.input(
id="input_2",
on_mount=rx.set_focus("input_2"),
),
rx.hstack(
rx.button('button1', on_click=rx.set_focus("input_1")),
rx.button('button2', on_click=rx.set_focus("input_2")),
)
)
) i think |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone,
Pressing button2 causes the following error. How can I resolve this issue?
Beta Was this translation helpful? Give feedback.
All reactions