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.

isSearchable + starts with functionality

See original GitHub issue

Hi, Is it possible to use isSearchable={true} with “starts with” functionality, instead of default “contains” functionality? For example: Options - 1. aa 2. ba 3. ac Searching “a” will cause only the following options to appear: “aa”, “ac” I found no documentation of this.

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
manvydasucommented, Jan 17, 2021

I believe you could just use custom filterOption and for those options, which should not be searchable, just filter them out whenever search input is non empty. For other options, just filter them with default ‘contains’.

1reaction
Methuselah96commented, Jan 29, 2021

You need to specify the type for filterConfig in order to defeat type-widening:

import { Config } from 'react-select/src/filters';

const filterConfig: Config = {
  matchFrom: 'start',
};

or

const filterConfig = {
  matchFrom: 'start' as const,
};
Read more comments on GitHub >

github_iconTop Results From Across the Web

IsSearchable not working on Filtered combobox?
Solved: Hi everyone, I customized via PowerApps the form of a SharePoint list. On this form I need a lookup to another list,...
Read more >
Power Apps StartsWith Filter to avoid Delegation ... - YouTube
The Power Apps StartsWith is a fabulous function you can use within your filter formula to provide some search capabilities without having ...
Read more >
PowerApps Combobox - Search, Filter, Default values, and more
If playback doesn't begin shortly, try restarting your device. Your browser can't play this video. Learn more. Switch camera.
Read more >
Using Select prop 'isSearchable' with JSX - Stack Overflow
The Select from react-select accepts an array of options where each option is an object with a label and value properties.
Read more >
[C#] AttributeMetadata "IsSearchable" always false
I'm trying to access AttributeMetadata using Microsoft.Xrm.Tooling.Connector (link) using the GetAllAttributesForEntity function. var ...
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