Skip to content

Commit

Permalink
Merge pull request #5378 from nextcloud-libraries/fix/5351/leading-sp…
Browse files Browse the repository at this point in the history
…ace-tribute

fix(NcRichContentEditable): require leading space to open tributes
  • Loading branch information
susnux authored Mar 8, 2024
2 parents cb58beb + 28ba0eb commit 7dad4d6
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,7 @@ export default {
fillAttr: 'id',
// Search against id and label (display name) (fallback to title for v8.0.0..8.6.1 compatibility)
lookup: result => `${result.id} ${result.label ?? result.title}`,
requireLeadingSpace: true,
// Popup mention autocompletion templates
menuItemTemplate: item => renderMenuItem(this.renderComponentHtml(item.original, NcAutoCompleteResult)),
// Hide if no results
Expand All @@ -582,6 +583,7 @@ export default {
// Don't use the tribute search function at all
// We pass search results as values (see below)
lookup: (result, query) => query,
requireLeadingSpace: true,
// Popup mention autocompletion templates
menuItemTemplate: item => {
if (textSmiles.includes(item.original)) {
Expand Down Expand Up @@ -630,6 +632,7 @@ export default {
// Don't use the tribute search function at all
// We pass search results as values (see below)
lookup: (result, query) => query,
requireLeadingSpace: true,
// Popup mention autocompletion templates
menuItemTemplate: item => renderMenuItem(`<img class="${this.$style['tribute-item__icon']}" src="${item.original.icon_url}"> <span class="${this.$style['tribute-item__title']}">${item.original.title}</span>`),
// Hide if no results
Expand Down

0 comments on commit 7dad4d6

Please sign in to comment.