Intermediate bugfix to autocomplete
This commit is contained in:
parent
6b5a572b64
commit
607cd707dc
|
@ -267,6 +267,7 @@ export default class TextAnnotator extends Component {
|
|||
annotation={this.state.selectedAnnotation}
|
||||
selectedElement={this.state.selectedDOMElement}
|
||||
config={this.props.config}
|
||||
env={this.props.env}
|
||||
applyTemplate={this.state.applyTemplate}
|
||||
onAnnotationCreated={this.onCreateOrUpdateAnnotation('onAnnotationCreated')}
|
||||
onAnnotationUpdated={this.onCreateOrUpdateAnnotation('onAnnotationUpdated')}
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
import React, { useState, useRef } from 'react'
|
||||
import React, { useState } from 'react'
|
||||
import { useCombobox } from 'downshift'
|
||||
|
||||
const Autocomplete = props => {
|
||||
|
||||
const element = useRef();
|
||||
|
||||
const [ inputItems, setInputItems ] = useState(props.vocabulary);
|
||||
|
||||
const onInputValueChange = ({ inputValue }) => {
|
||||
|
@ -58,12 +56,11 @@ const Autocomplete = props => {
|
|||
}
|
||||
|
||||
return (
|
||||
<div ref={element} className="r6o-autocomplete">
|
||||
<div className="r6o-autocomplete">
|
||||
<div {...getComboboxProps()}>
|
||||
<input
|
||||
{...getInputProps({ onKeyUp })}
|
||||
placeholder={props.placeholder}
|
||||
defaultValue={props.initialValue} />
|
||||
placeholder={props.placeholder} />
|
||||
</div>
|
||||
<ul {...getMenuProps()}>
|
||||
{isOpen && inputItems.map((item, index) => (
|
||||
|
|
Loading…
Reference in New Issue