Fix @/% suggestion regression

See https://github.com/ueberdosis/tiptap/pull/3239
This commit is contained in:
Austin Chen 2022-10-13 19:05:56 -07:00
parent abd06f272b
commit 3a63503161
2 changed files with 2 additions and 0 deletions

View File

@ -14,6 +14,7 @@ const beginsWith = (text: string, query: string) =>
export const contractMentionSuggestion: Suggestion = { export const contractMentionSuggestion: Suggestion = {
char: '%', char: '%',
allowSpaces: true, allowSpaces: true,
allowedPrefixes: [' '],
pluginKey: new PluginKey('contract-mention'), pluginKey: new PluginKey('contract-mention'),
items: async ({ query }) => items: async ({ query }) =>
orderBy( orderBy(

View File

@ -14,6 +14,7 @@ const beginsWith = (text: string, query: string) =>
// copied from https://tiptap.dev/api/nodes/mention#usage // copied from https://tiptap.dev/api/nodes/mention#usage
export const mentionSuggestion: Suggestion = { export const mentionSuggestion: Suggestion = {
allowedPrefixes: [' '],
items: async ({ query }) => items: async ({ query }) =>
orderBy( orderBy(
(await getCachedUsers()).filter((u) => (await getCachedUsers()).filter((u) =>