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
I'd like to get an event at <form> when the react-select element is changed (user input). Currently it works with normal <input> Elements (text, radio, ...), and react-select is included when I use onSubmit, but not with <form onChange>
Reason is, that I have a custom logic with controlled elements, which is centrally notified from <form onChange>-Events.
As a workaround it would be possible to add onChange individually to a <Select> (which would work), but I don't want to pass the "onChange"-prop down multiple levels of components. As workaround I could use React.Context.
I would prefer a native solution for react-select. Is this possible with react-select?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
I'd like to get an event at
<form>
when the react-select element is changed (user input). Currently it works with normal<input>
Elements (text, radio, ...), and react-select is included when I use onSubmit, but not with<form onChange>
Demo:
https://codesandbox.io/s/test-ldlerk?file=/example.tsx
Reason is, that I have a custom logic with controlled elements, which is centrally notified from
<form onChange>
-Events.As a workaround it would be possible to add onChange individually to a
<Select>
(which would work), but I don't want to pass the "onChange"-prop down multiple levels of components. As workaround I could use React.Context.I would prefer a native solution for react-select. Is this possible with react-select?
Thank you and best regards,
Beta Was this translation helpful? Give feedback.
All reactions