This commit is contained in:
Rainer Simon 2020-10-13 14:51:26 +02:00
parent f71f9dfc09
commit de71349d15
2 changed files with 5 additions and 2 deletions

View File

@ -62,7 +62,7 @@ export default class Autocomplete extends Component {
if (evt.which == 13 && highlightedIndex == -1) {
onSubmit(value);
} else if (evt.which == 40 && value.length == 0) {
setInputItems(this.props.vocabulary); // Show all options on key down
this.setState({ inputItems: this.props.vocabulary }); // Show all options on key down
} else if (evt.which == 27) {
this.props.onCancel && this.props.onCancel();
} else {

View File

@ -26,6 +26,7 @@ export default class RelationEditor extends Component {
constructor(props) {
super(props);
this.element = React.createRef();
}
@ -47,7 +48,9 @@ export default class RelationEditor extends Component {
}
}
onSubmit = value => {
onSubmit = () => {
const value = this.element.current.querySelector('input').value;
const updatedAnnotation = this.props.relation.annotation.clone({
motivation: 'linking',
body: [{