From 3a63503161dccbc76e56b5f558c6237bc9392f0c Mon Sep 17 00:00:00 2001 From: Austin Chen Date: Thu, 13 Oct 2022 19:05:56 -0700 Subject: [PATCH] Fix @/% suggestion regression See https://github.com/ueberdosis/tiptap/pull/3239 --- web/components/editor/contract-mention-suggestion.ts | 1 + web/components/editor/mention-suggestion.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/web/components/editor/contract-mention-suggestion.ts b/web/components/editor/contract-mention-suggestion.ts index 39d024e7..38262946 100644 --- a/web/components/editor/contract-mention-suggestion.ts +++ b/web/components/editor/contract-mention-suggestion.ts @@ -14,6 +14,7 @@ const beginsWith = (text: string, query: string) => export const contractMentionSuggestion: Suggestion = { char: '%', allowSpaces: true, + allowedPrefixes: [' '], pluginKey: new PluginKey('contract-mention'), items: async ({ query }) => orderBy( diff --git a/web/components/editor/mention-suggestion.ts b/web/components/editor/mention-suggestion.ts index b4eeeebe..7e21e0f7 100644 --- a/web/components/editor/mention-suggestion.ts +++ b/web/components/editor/mention-suggestion.ts @@ -14,6 +14,7 @@ const beginsWith = (text: string, query: string) => // copied from https://tiptap.dev/api/nodes/mention#usage export const mentionSuggestion: Suggestion = { + allowedPrefixes: [' '], items: async ({ query }) => orderBy( (await getCachedUsers()).filter((u) =>