react-gears icon indicating copy to clipboard operation
react-gears copied to clipboard

<FormRow type="checkbox" /> does not work with multiple selections

Open gthomas-appfolio opened this issue 8 years ago • 2 comments

Using FormRow type="checkbox" does not work with multiple selections. The onChange will only return a value when checked, but returns empty array when unchecked, which makes it impossible to determine what was deselected.

gthomas-appfolio avatar Oct 12 '17 17:10 gthomas-appfolio

@gthomas-appfolio Can you post the steps to reproduce? Thanks

joelbandi avatar Oct 17 '17 19:10 joelbandi

Sure, if you use the FormRow+FormChoice such as this example from Forms>Forms with Objects:

<FormRow type="checkbox" label="Select the character(s) you like" onChange={...}>
  <FormChoice>Darth Vader</FormChoice>
  <FormChoice>Luke Skywalker</FormChoice>
  <FormChoice disabled>Emperor Palpatine</FormChoice>
  <FormChoice>Rey</FormChoice>
  <FormChoice>TK-421</FormChoice>
</FormRow>

onChange is unusable to control an array of selections, it seems impossible to determine if you have unchecked some choices.

gthomas-appfolio avatar Oct 23 '17 15:10 gthomas-appfolio