From 6b5a572b6406b29c6e495f4b8f169601eb5719ac Mon Sep 17 00:00:00 2001 From: Rainer Simon Date: Thu, 24 Sep 2020 16:59:13 +0200 Subject: [PATCH] Bugfix --- src/editor/widgets/Autocomplete.js | 10 +++++----- src/editor/widgets/tag/TagWidget.jsx | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/editor/widgets/Autocomplete.js b/src/editor/widgets/Autocomplete.js index 8dbb549..b018967 100644 --- a/src/editor/widgets/Autocomplete.js +++ b/src/editor/widgets/Autocomplete.js @@ -43,7 +43,7 @@ const Autocomplete = props => { props.onSubmit(inputValue); } - const onKeyDown = evt => { + const onKeyUp = evt => { const { value } = evt.target; if (evt.which == 13 && highlightedIndex == -1) { @@ -52,6 +52,8 @@ const Autocomplete = props => { setInputItems(props.vocabulary); // Show all options on key down } else if (evt.which == 27) { props.onCancel && props.onCancel(); + } else { + props.onChange && props.onChange(value); } } @@ -59,11 +61,9 @@ const Autocomplete = props => {
props.onChange && props.onChange(evt)} + {...getInputProps({ onKeyUp })} placeholder={props.placeholder} - defaultValue={props.initialValue} - /> + defaultValue={props.initialValue} />