I'm using a multi-input Typeahead component, and I want to be able to click to remove previously selected elements (maintain this existing functionality), but _not_ type in the input field. The current "disabled" property almost does this, but it also prevents the selected elements from being deselected.
You can pass readOnly to the input via inputProps:
<Typeahead
inputProps={{
readOnly: true,
}}
multiple
...
/>
This will prevent typing in the input, but will not prevent the menu from opening when the component is focused, and users can therefore select additional items. That's potentially a bug.
I'm not entirely sure I understand the behavior you're after, however, since a true readonly input wouldn't allow the user to either add or remove selections.
Reading the spec, it actually looks like only input and textarea can be readonly, while select, among others, cannot.
So I think the current behavior actually seems correct in not allowing users to enter text but allowing selections.
I think I've answered your question and I don't believe there are any bugs in terms of the current behavior, so I'm going to close this out. Feel free to re-open if you disagree.
Thanks, this was exactly what I was looking for!
Most helpful comment
I think I've answered your question and I don't believe there are any bugs in terms of the current behavior, so I'm going to close this out. Feel free to re-open if you disagree.