Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Checkbox input not saving checked state #42

Open
IlirBajrami opened this issue May 17, 2022 · 0 comments
Open

Checkbox input not saving checked state #42

IlirBajrami opened this issue May 17, 2022 · 0 comments

Comments

@IlirBajrami
Copy link

IlirBajrami commented May 17, 2022

I'm trying to implement a form with checkboxes like this:

{Object.entries(Services).map(([value, name]) => (
        <FormItem
          id={value}
          key={value}
          label={name}
          name={name}
          value={value}
         
          onChange={setForm}
          type='checkbox'
        />
      ))}

but when i click next and then back again (of course using navigation from your useStep helper) the checkbox i previously checked is not checked anymore. How can i fix this or i have to write separate function to keep the state?

Note: The state is saved just fine on other input types using useForm, except checkbox.

EDIT: The state is not saved on any field except type text. Noticed that even if the field is of type textarea, it's not saved

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant