Mention plugin should allow custom filtering function #503
Replies: 4 comments
-
It's a good suggestion, we should provide a filter function that gives the item as argument, where the default is just filtering with substring. |
Beta Was this translation helpful? Give feedback.
-
Hi @zbeyens. I'll try to rework anything you should find necessary. |
Beta Was this translation helpful? Give feedback.
-
Great! Prettier is integrated in eslint rules so we don't use prettier cli. |
Beta Was this translation helpful? Give feedback.
-
@zbeyens. Closing this now. thanks alot for your quick approval of the PR. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I have a use case where i would like to be able to mention users by filtering either on their full name OR their email yet only store their User ID in slate document.
It appears filtering is hard coded and basically matches if substring is included in value.
Furthermore. This value stored in slate format, and is not an ID but a label.
For instance, if i set mentionables values to the full name of users, should their name change (marrying for instance), i cannot keep track of their mentions with their previous name.
Since
MentionNodeData
seem to allow various information on Mentionables :[key: string]: any;
L25, it would seem appropriate to allow a custom filtering method that would take a mentionable and return if they match or not. We also would require a rendering function to choose how a mentionable is displayed.Then we could have the value of the mentionable be a user ID instead of a name.
Does that make sense for you ? Did i miss a feature that allows such a use case ?
Thanks for your feedback on this.
Cheers
Beta Was this translation helpful? Give feedback.
All reactions