fix: selected values must be at the start of the dropdown
This commit is contained in:
parent
ef9f8b49a6
commit
ddf488e3b7
1 changed files with 8 additions and 3 deletions
|
|
@ -42,10 +42,15 @@ const Autocomplete = ({
|
|||
onChange(evt, rValue)
|
||||
}
|
||||
|
||||
const filterOptions = (options, { inputValue }) =>
|
||||
sort(options, inputValue, { keys: ['code', 'display'] }).slice(
|
||||
const valueArray = () => (multiple ? value : [value])
|
||||
|
||||
const filter = (array, input) =>
|
||||
sort(array, input, { keys: ['code', 'display'] })
|
||||
|
||||
const filterOptions = (array, { inputValue }) =>
|
||||
R.union(valueArray(), filter(array, inputValue)).slice(
|
||||
0,
|
||||
R.defaultTo(undefined)(limit)
|
||||
R.defaultTo(undefined)(limit) && Math.max(limit, valueArray().length)
|
||||
)
|
||||
|
||||
return (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue