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.

Search input shows wrong value

See original GitHub issue

I’m using the latest release of react-select 3.2.0, look at the screen. Can anybody tell me how this is possible?

Schermafbeelding 2021-01-22 om 13 24 20

I use this props, it’s a grouped select:

defaultValue: null isDisabled: false isMulti: false options: (6) [{…}, {…}, {…}, {…}, {…}, {…}] placeholder: "Alle objecten" isClearable: true value: null

Can someone help me?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

6reactions
Rall3ncommented, Jan 22, 2021

@dmeij Yes, by default the component searches through both value and label.

If you want to only search through the label you have to use the filterOption prop in conjunction with the createFilter function exposed from the package. This will create a new filter function based on a configuration you provide.

import Select, { createFilter } from 'react-select';

const customFilterOption = createFilter({
    stringify: option => option.label // Default is `${option.label} ${option.value}`
});

/* ... */

<Select
    filterOption={customFilterOption}
 />
0reactions
dmeijcommented, Jan 22, 2021

Works, thnx!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Text input showing wrong value after browsers back button is ...
1 Answer 1 ... The browser is likely showing what it last saw as your input to the form, as opposed to what...
Read more >
<input type="search"> - HTML: HyperText Markup Language
If no minlength is specified, or an invalid value is specified, the search input has no minimum length.
Read more >
Combo box displaying wrong value on form but passing ...
I have a combo box cmbSponsorName with control source (from tblSponsors) the field SponsorName.
Read more >
Search help is populating the input field with wrong data
I created search help on table ZCITY with export parameters as ZZCITY and ZZNAME. In SE11, I have mapped the export parameters with...
Read more >
Form Input | Components - BootstrapVue
Create various type inputs such as: text , password , number , url , email , search , range , date and more....
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