Skip to content

ClayMultiSelect doesn't register an 'onChange' event when it is inside of a form #5524

@bryceosterhaus

Description

@bryceosterhaus

https://codesandbox.io/s/quirky-snow-jrpflb?file=/src/index.js

What are the steps to reproduce?

Open up the console to see the logs. When typing into a ClayInput, the form's onChange fires when the input is typed into. But when you select an item in the MultiSelect component, it doesn't register in the form's onChange prop. Note that the hidden input of MultiSelect does have the value change.

What is the expected result?

I would expect that the form's onChange would pick up new values when they added to the MultiSelect's hidden input values.


I also noticed that the multiSelect creates a new hidden input for every new item selected, I think this might be wrong and it should instead aggregate all the values into something like <input value="one,two" type="hidden" />.

Screenshot 2023-05-11 at 2 03 39 PM

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugIssues reporting that Component is not doing what should be done

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions