fix: remove selected item preference when something is typed
This commit is contained in:
parent
ddf488e3b7
commit
4b98f3503f
1 changed files with 6 additions and 2 deletions
|
|
@ -48,9 +48,13 @@ const Autocomplete = ({
|
|||
sort(array, input, { keys: ['code', 'display'] })
|
||||
|
||||
const filterOptions = (array, { inputValue }) =>
|
||||
R.union(valueArray(), filter(array, inputValue)).slice(
|
||||
R.union(
|
||||
R.isEmpty(inputValue) ? valueArray() : [],
|
||||
filter(array, inputValue)
|
||||
).slice(
|
||||
0,
|
||||
R.defaultTo(undefined)(limit) && Math.max(limit, valueArray().length)
|
||||
R.defaultTo(undefined)(limit) &&
|
||||
Math.max(limit, R.isEmpty(inputValue) ? valueArray().length : 0)
|
||||
)
|
||||
|
||||
return (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue