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.

using react-select as select only without option for entries

See original GitHub issue

Hey, I’m trying to prevent the user from any type of entries inside the input, so react-select will be used as a simple <Select> html tag, I faced this issue while I was trying to search for solution

/issues/758

but its mainly about auto-complete … I want to prevent the use of typing anything at all (when opening the select), just a selection. and idea how can it be done ?

thanks.

Issue Analytics

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

github_iconTop GitHub Comments

41reactions
cutterblcommented, Oct 29, 2018

@Danny-weebo For future reference, questions like this are best left for StackOverflow, and don’t really fall into the repo bug tracker. That said, what you’re looking for is the isSearchable prop. If you set this to false, then the user will use your select like a standard select, without the ability to type and filter in the Control.

<Select {...otherProps} isSearchable={false} />

The API docs are really helpful here. It’s a lot of information (it’s a powerful component), but worth reading through.

0reactions
christinavarghese06commented, May 4, 2021

@Danny-weebo For future reference, questions like this are best left for StackOverflow, and don’t really fall into the repo bug tracker. That said, what you’re looking for is the isSearchable prop. If you set this to false, then the user will use your select like a standard select, without the ability to type and filter in the Control.

<Select {...otherProps} isSearchable={false} />

The API docs are really helpful here. It’s a lot of information (it’s a powerful component), but worth reading through.

Thank you so much , wasted hours to resolve this issue. This really helped.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Select with options outside - Prepsheets
Setting up react-select to render options outside the select for more space.
Read more >
Advanced - React Select
A flexible and beautiful Select Input control for ReactJS with multiselect, autocomplete and ajax support.
Read more >
How to use react-select without options list? - Stack Overflow
import CreatableSelect from 'react-select/creatable'; export type OptionType = { value: string; label: string; __isNew__?
Read more >
react-select: An introduction - LogRocket Blog
In the App.js file, we import two items at the top of the file, the react and react-select package respectively like this:
Read more >
Forms - React
In HTML, form elements such as <input> , <textarea> , and <select> ... kept in the state property of components, and only updated...
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