[V2] Creatable throws with custom value / label fields
See original GitHub issueDescription:
Go to https://codesandbox.io/s/qj18wmroj and start typing in the select box. Throws TypeError: Cannot read property 'toLowerCase' of undefined
.
Cause:
Creatable.js’s https://github.com/JedWatson/react-select/blob/v2.0.0-beta.7/src/Creatable.js#L41-L42 function incorrectly assumes the options
object has label
and value
properties.
Possible Fix
compareOption
should use getOptionLabel
/ getOptionValue
before referencing the properties.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:11
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Error thrown when the Custom Label is set to Protected ...
1. Create Custom Label (Setup-> Create-> Custom Labels-> [New Custom Label]). Make sure the 'Protected Component' is checked.
Read more >Flow: How to update a record using a custom label and a ...
Step 1: First step is to create a custom label. We will assign the value “a0d1v00000m0GtlAAE”, which is the record id for the...
Read more >Update Date field with the value of custom label in Process ...
It won't work for DATE($Label.NYResident_ExpDate). I have used DATEVALUE function like shown below. DATEVALUE($Label.NYResident_ExpDate).
Read more >Dynamically populate a select field's choices - ACF
This tutorial will cover how to take a value saved to the options page and ... field is called my_select_values ) and use...
Read more >Custom label 0-4 [custom_label_0-4] (Collections)
Custom labels allow you to create specific filters to use in your collections. ... up to 1,000 unique values account-wide for each custom...
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
Ping @JedWatson
I had this issue.
Reason why it is throwing this error: compareOption function is trying to first
toLowerCase()
the option value and label and then compare it with the characters (string) we are typing. So if you are passing anyone of them (value and label) as number or other than string, it will throw an error.Here is what I did & it worked for me.
And hope it works for everyone here as well. 😄
1. Mapped the array before hand:
Creatable
Component