We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 48b405a commit 43c081cCopy full SHA for 43c081c
1 file changed
reflex/.templates/web/utils/state.js
@@ -243,13 +243,13 @@ export const applyEvent = async (event, socket) => {
243
if (event.name == "_set_focus") {
244
const ref =
245
event.payload.ref in refs ? refs[event.payload.ref] : event.payload.ref;
246
- const focus = ref?.current?.focus;
247
- if (focus === undefined) {
+ const current = ref?.current;
+ if (current === undefined || current?.focus === undefined) {
248
console.error(
249
`No element found for ref ${event.payload.ref} in _set_focus`,
250
);
251
} else {
252
- focus();
+ current.focus();
253
}
254
return false;
255
0 commit comments