fix: autocomplete input not showing available options
fix: remove log
This commit is contained in:
parent
17e1da61f3
commit
175a98d50f
4 changed files with 28 additions and 6 deletions
|
|
@ -49,8 +49,10 @@ const Autocomplete = ({
|
||||||
return multiple ? value : [value]
|
return multiple ? value : [value]
|
||||||
}
|
}
|
||||||
|
|
||||||
const filter = (array, input) =>
|
const filter = (array, input) => {
|
||||||
sort(array, input, { keys: [valueProp, labelProp] })
|
if (!input) return array
|
||||||
|
return sort(array, input, { keys: [valueProp, labelProp] })
|
||||||
|
}
|
||||||
|
|
||||||
const filterOptions = (array, { inputValue }) =>
|
const filterOptions = (array, { inputValue }) =>
|
||||||
R.union(
|
R.union(
|
||||||
|
|
|
||||||
|
|
@ -54,12 +54,22 @@ const Wizard = ({ machine, locale, onClose, save, error }) => {
|
||||||
{
|
{
|
||||||
type: 'top',
|
type: 'top',
|
||||||
display: 'Cassette 1 (Top)',
|
display: 'Cassette 1 (Top)',
|
||||||
component: Autocomplete
|
component: Autocomplete,
|
||||||
|
inputProps: {
|
||||||
|
options: R.map(it => ({ code: it, display: it }))(options),
|
||||||
|
labelProp: 'display',
|
||||||
|
valueProp: 'code'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'bottom',
|
type: 'bottom',
|
||||||
display: 'Cassette 2',
|
display: 'Cassette 2',
|
||||||
component: Autocomplete
|
component: Autocomplete,
|
||||||
|
inputProps: {
|
||||||
|
options: R.map(it => ({ code: it, display: it }))(options),
|
||||||
|
labelProp: 'display',
|
||||||
|
valueProp: 'code'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'zeroConfLimit',
|
type: 'zeroConfLimit',
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,12 @@ export default {
|
||||||
display: 'Environment',
|
display: 'Environment',
|
||||||
component: Autocomplete,
|
component: Autocomplete,
|
||||||
inputProps: {
|
inputProps: {
|
||||||
options: ['prod', 'test']
|
options: [
|
||||||
|
{ code: 'prod', display: 'prod' },
|
||||||
|
{ code: 'test', display: 'test' }
|
||||||
|
],
|
||||||
|
labelProp: 'display',
|
||||||
|
valueProp: 'code'
|
||||||
},
|
},
|
||||||
face: true
|
face: true
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,12 @@ const singleBitgo = code => ({
|
||||||
display: 'Environment',
|
display: 'Environment',
|
||||||
component: Autocomplete,
|
component: Autocomplete,
|
||||||
inputProps: {
|
inputProps: {
|
||||||
options: ['prod', 'test']
|
options: [
|
||||||
|
{ code: 'prod', display: 'prod' },
|
||||||
|
{ code: 'test', display: 'test' }
|
||||||
|
],
|
||||||
|
labelProp: 'display',
|
||||||
|
valueProp: 'code'
|
||||||
},
|
},
|
||||||
face: true
|
face: true
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue