Single select propagates an array instead of an object in onChange()
See original GitHub issueI have a <Select>
component with { multi: false, searchable: true }
. Firstly I selected an option, and when I pressed backspace, it deleted the value and propagated the new value in onChange()
. However, the new value is an empty array instead of null
or something else.
I got a warning when setting the new value to <Select>
, it says:
Warning: Failed prop type: Invalid prop
value
of typearray
supplied toValue
, expectedobject
. in Value (created by Select) in Select
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How to handle OnChange of array property which is 'react ...
value to 'prodId' only. I want to set onChange for property 'prodId' of the array of object using Select element of 'react-select'. I...
Read more >Data binding - Polymer Project
If the property being bound is an object or an array, both elements get a reference to the same object. This means that...
Read more >SCR19: Using an onchange event on a select element ... - W3C
The objective of this technique is to demonstrate how to correctly use an onchange event with a select element to update other elements...
Read more >Google Visualization API Reference | Charts
numberOrArray is either a number of new, empty rows to add, or an array of one or more populated rows to add at...
Read more >Introduction to events - Learn web development | MDN
This might be a single element, a set of elements, the HTML document ... Objects that can fire events have an addEventListener() method, ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@gao-sun This will be resolved by #773
@nealoke It’s not up to me. I’d certainly like to see it merged since I’m getting emails about it every couple of weeks for the last year. Perhaps @agirton can help?