From 924ab156f3dc78b29f4a173e563f1713f08125c8 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Thu, 14 Sep 2023 09:11:18 -0400 Subject: [PATCH] fix: Allow mention and emoji menus in headings --- shared/editor/extensions/Suggestion.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shared/editor/extensions/Suggestion.tsx b/shared/editor/extensions/Suggestion.tsx index dac0df174..64bdf2d76 100644 --- a/shared/editor/extensions/Suggestion.tsx +++ b/shared/editor/extensions/Suggestion.tsx @@ -14,9 +14,10 @@ export default class Suggestion extends Extension { inputRules = (_options: { type: NodeType; schema: Schema }) => [ new InputRule(this.options.openRegex, (state, match) => { + const { parent } = state.selection.$from; if ( match && - state.selection.$from.parent.type.name === "paragraph" && + (parent.type.name === "paragraph" || parent.type.name === "heading") && (!isInCode(state) || this.options.enabledInCode) && (!isInTable(state) || this.options.enabledInTable) ) {