You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unable to make all the form fields touched programmatically. #1468
const formOptions = useFormApi();
const {lastOpened, setFormState} = useAppContext();
const {fields} = useFieldsApi(props);
//This if condition is to extract all the fields which were last opened and it is working as expected.
if (fields && fields.length) {
const filteredFieldItems = fields.filter((field:any)=> field.name === lastOpened)
}
if(filteredFieldItems && filtteredFieldItems.length) {
filteredFieldItems[0].fields.forEach((field:any)=> {
formOptions.focus(field.name);
})
}
The line highlighted above does not focus the fields. Is that a correct syntax? I am able to extract the fields .
Activity