fix: Suggestion menus should close after typing space beyond trigger
closes #5387
This commit is contained in:
@@ -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) => ({
|
||||||
|
|||||||
@@ -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;
|
||||||
}),
|
}),
|
||||||
|
|||||||
Reference in New Issue
Block a user