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.focus();
}
if (this.state.suggestionsMenuOpen !== type) {
if (type && this.state.suggestionsMenuOpen !== type) {
return;
}
this.setState((state) => ({

View File

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