Skip to content

Commit 446043a

Browse files
fix: function textinput crash
1 parent e568493 commit 446043a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/useFormState.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,10 @@ export function useInnerContext(skip?: boolean) {
202202
.flat();
203203

204204
const nextField = fields.find((f) => {
205-
const p = f.element.props;
205+
const p = f?.element?.props;
206+
// TODO: fix this with function components
206207
// skip disabled fields in focus
207-
if ((p as any).disabled === true || p.editable === false) {
208+
if ((p as any)?.disabled === true || p?.editable === false) {
208209
return false;
209210
}
210211
// already sorted so the first one to hit above current index is the next field

0 commit comments

Comments
 (0)