Skip to content

Filter data using the first character that user types in the input box #4536

Answered by ebonow
developersatyajit asked this question in Q&A
Discussion options

You must be logged in to vote

Greetings @developersatyajit

It sounds like you would want to create a filter to change the logic being used for string matching. There is some documentation here, and it looks like you want to use createFilter to change the default value of matchFrom to start instead of any

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

const filterOption = createFilter({ matchFrom: 'start' });

return <Select filterOption={filterOption} {...otherProps} />

Please let me know if this works for you.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@developersatyajit
Comment options

Answer selected by ebonow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants