Closed nirajjoshi closed 3 years ago
That is because you have an exact match, which adds that suggestion. If you style the Mention
widget, it will be a more clear user experience that once you've typed "@jhon" completely or selected it from the suggestions, it has been added. Example:
mentions: [
Mention(
trigger: "@",
data: <YOUR DATA LIST>,
style: TextStyle(
color: Theme.of(context).primaryColor,
fontFamily: "Karla",
fontSize: 16.0
),
),
]
@mlars84 Thanks for reply. This user experience does makes sense but issue is even after typing full name & moving ahead it doesn't get highlighted like it gets highlighted even though john is there in data list, when we select from suggestions list.
@nirajjoshi The way to get around this issue is to store all the list items you query in a temp variable and keep pushing new items to the list, this will keep the mentions working, the reason for not highlighting the typed out mention is that the list won't contain the item
@fayeed Thanks. I will do that.
@fayeed Thanks. I will do that.
Hey could you share what you have done ? Im not understanding what @fayeed advice
@Abacaxi-Nelson As @fayeed already explained all we need to do is make items available in the list we provide (_allMentionList in below example code).
mentions: [
Mention(
trigger: '@',
data: _allMentionList, // Just make sure your data items are present here to identify mentioned item.
matchAll: false,
suggestionBuilder: _buildSuggessionBuilderUI,
markupBuilder: (trigger, mention, value) {
return '[mentionId:$mention]<end>';
},
),
],
Closing this as I was able to resolve issue using @fayeed 's comments.
Normally it is working fine. Like right after typing initial letters from display name after @ it starts showing mention results to select. On tapping on mention suggestions it is added to textfield with highlighted color as well.
However there is some issue when we type full display name after @. Like if the display name is John then till typing @Joh it shows mention result suggestions. Right after we type @John suggestions disappear & there is no way to tag (mention) that user. Please refer screenshots for more reference. They are right from the sample app.
Please do the needful.