From de71349d1504d0e23eaf48d43fb5eb094326de80 Mon Sep 17 00:00:00 2001 From: Rainer Simon Date: Tue, 13 Oct 2020 14:51:26 +0200 Subject: [PATCH] Bugfix --- src/editor/widgets/Autocomplete.js | 2 +- src/relations/editor/RelationEditor.jsx | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/editor/widgets/Autocomplete.js b/src/editor/widgets/Autocomplete.js index c35a0a5..2073e3e 100644 --- a/src/editor/widgets/Autocomplete.js +++ b/src/editor/widgets/Autocomplete.js @@ -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 { diff --git a/src/relations/editor/RelationEditor.jsx b/src/relations/editor/RelationEditor.jsx index 7d08af0..c436881 100644 --- a/src/relations/editor/RelationEditor.jsx +++ b/src/relations/editor/RelationEditor.jsx @@ -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: [{