diff --git a/server/routes/api/suggestions/suggestions.ts b/server/routes/api/suggestions/suggestions.ts index 0e0d709e31..eac32db6db 100644 --- a/server/routes/api/suggestions/suggestions.ts +++ b/server/routes/api/suggestions/suggestions.ts @@ -35,17 +35,20 @@ router.post( suspendedAt: { [Op.eq]: null, }, - [Op.and]: { - [Op.or]: [ - Sequelize.literal( - `unaccent(LOWER(email)) like unaccent(LOWER(:query))` - ), - Sequelize.literal( - `unaccent(LOWER(name)) like unaccent(LOWER(:query))` - ), - ], - }, + [Op.and]: query + ? { + [Op.or]: [ + Sequelize.literal( + `unaccent(LOWER(email)) like unaccent(LOWER(:query))` + ), + Sequelize.literal( + `unaccent(LOWER(name)) like unaccent(LOWER(:query))` + ), + ], + } + : {}, }, + order: [["name", "ASC"]], replacements: { query: `%${query}%` }, offset, limit, diff --git a/shared/editor/components/Styles.ts b/shared/editor/components/Styles.ts index abc958a7b1..f46826f8d6 100644 --- a/shared/editor/components/Styles.ts +++ b/shared/editor/components/Styles.ts @@ -303,6 +303,11 @@ width: 100%; gap: 4px; vertical-align: bottom; + &:hover { + text-decoration: none; + cursor: default; + } + &.mention-user::before { content: "@"; } diff --git a/shared/editor/nodes/Mention.tsx b/shared/editor/nodes/Mention.tsx index f63cc61f1b..88e748f8f0 100644 --- a/shared/editor/nodes/Mention.tsx +++ b/shared/editor/nodes/Mention.tsx @@ -46,6 +46,7 @@ export default class Mention extends Extension { { tag: `.${this.name}`, preserveWhitespace: "full", + priority: 100, getAttrs: (dom: HTMLElement) => { const type = dom.dataset.type; const modelId = dom.dataset.id;