close autocomplete on enter

This commit is contained in:
Bruno Windels
2019-05-14 15:38:16 +01:00
parent ffff66a92d
commit 22587da5ff
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -34,7 +34,7 @@ export default class AutocompleteWrapperModel {
}
onEnter() {
this._updateCallback({close: true});
}
onTab() {
+3 -1
View File
@@ -116,7 +116,9 @@ export default class EditorModel {
}
_onAutoComplete = ({replacePart, replaceCaret, close}) => {
this._replacePart(this._autoCompletePartIdx, replacePart);
if (replacePart) {
this._replacePart(this._autoCompletePartIdx, replacePart);
}
const index = this._autoCompletePartIdx;
if (close) {
this._autoComplete = null;