question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Single select propagates an array instead of an object in onChange()

See original GitHub issue

I 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 type array supplied to Value, expected object.     in Value (created by Select)     in Select

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
MrLeebocommented, Mar 10, 2017

@gao-sun This will be resolved by #773

2reactions
MrLeebocommented, May 31, 2017

@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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found