ui-kit icon indicating copy to clipboard operation
ui-kit copied to clipboard

<SelectField> and <AsyncSelectField> passes value in different format

Open jaikumar-tj opened this issue 2 years ago • 1 comments

Describe the bug The onChange callback for AsyncSelectField and SelectField is passing "value" in a different format. The storybook description says the "target.value" will hold the value but its not the case for AsyncSelectField.

Screenshot 2023-06-28 at 11 39 16

To Reproduce Steps to reproduce the behavior:

  1. render both <SelectField> and <AsyncSelectFIeld> using the same default options
  2. click on any option
  3. see the "event" object passed in onChange method

Screenshots Screenshot 2023-06-27 at 20 15 22

Additional context Either the code needs to changed or the storybook description needs to updated to indicate the correct value for target.value

jaikumar-tj avatar Jun 28 '23 09:06 jaikumar-tj

Hey 👋, Thank you for reporting. Just to share some additional context - this issue can also be observed in other components. onChange in:

  • SelectableSearchInput behaves like in SelectInput/SelectField in that regard
  • AsyncCreatableSelectInput and CreatableSelectInput behaves like in AsyncSelectInput/AsyncSelectField

kark avatar Jun 28 '23 10:06 kark