Convert Autocmplete from tabs to spaces

This commit is contained in:
Lukas Martinelli 2016-12-30 20:46:27 +01:00
parent 7bc2323401
commit 48f10bcb73

View file

@ -13,41 +13,44 @@ class AutocompleteInput extends React.Component {
} }
render() { render() {
return <Autocomplete return <Autocomplete
menuStyle={{ menuStyle={{
border: 'none', border: 'none',
padding: '2px 0', padding: '2px 0',
position: 'fixed', position: 'fixed',
overflow: 'auto', overflow: 'auto',
maxHeight: '50%', maxHeight: '50%',
}} background: colors.gray,
inputProps={{ zIndex: 3,
}}
inputProps={{
style: { style: {
...input.input, ...input.input,
width: null, width: null,
...this.props.style, ...this.props.style,
} }
}} }}
value={this.props.value} value={this.props.value}
items={this.props.options} items={this.props.options}
getItemValue={(item) => item[0]} getItemValue={(item) => item[0]}
onSelect={v => this.props.onChange(v)} onSelect={v => this.props.onChange(v)}
onChange={(e, v) => this.props.onChange(v)} onChange={(e, v) => this.props.onChange(v)}
renderItem={(item, isHighlighted) => ( renderItem={(item, isHighlighted) => (
<div <div
key={item[0]} key={item[0]}
style={{ style={{
userSelect: 'none', userSelect: 'none',
color: colors.lowgray, color: colors.lowgray,
background: isHighlighted ? colors.midgray : colors.gray, background: isHighlighted ? colors.midgray : colors.gray,
padding: margins[0], padding: margins[0],
fontSize: fontSizes[5], fontSize: fontSizes[5],
}} zIndex: 3,
> }}
{item[1]} >
</div> {item[1]}
)} </div>
/> )}
/>
} }
} }