fix: Suggestion menus should close after typing space beyond trigger

closes #5387
This commit is contained in:
Tom Moor
2023-05-25 22:21:26 -04:00
parent d57ec39113
commit aa80f5667f
2 changed files with 5 additions and 2 deletions

View File

@@ -711,7 +711,7 @@ export class Editor extends React.PureComponent<
this.view.dispatch(transaction); this.view.dispatch(transaction);
this.view.focus(); this.view.focus();
} }
if (this.state.suggestionsMenuOpen !== type) { if (type && this.state.suggestionsMenuOpen !== type) {
return; return;
} }
this.setState((state) => ({ this.setState((state) => ({

View File

@@ -29,7 +29,10 @@ export default class Suggestion extends Extension {
}), }),
new InputRule(this.options.closeRegex, (state, match) => { new InputRule(this.options.closeRegex, (state, match) => {
if (match) { if (match) {
this.editor.events.emit(EventType.SuggestionsMenuClose); this.editor.events.emit(
EventType.SuggestionsMenuClose,
this.options.type
);
} }
return null; return null;
}), }),