- Home
- Forum
- JavaScript - EJ 2
- Mention control not working as expected (with allowSpaces=true)
Mention control not working as expected (with allowSpaces=true)
Hi,
Can you please have a look at this example:
https://stackblitz.com/edit/js-f1u4ck?file=index.js
mentionChar is '@ME'.
Test scenario:
When I type '@ME' I see the full array (3 entries) => OK
When I type '@MEVAN' I see 1 entry => OK
When I type '@MEVAN P' I see 0 entries => NOT OK: this is not correct as I should still see the 'VAN POUCKE' entry, no?
Looks like the 'space' option (
) is not working?
Thx for checking
Frederik
I've been looking a bit further into this and when I change to 1 single mention char only (for example '@' iso '@ME'), then it works but i would like to use different mention strings to search in different arrays.
For example '@ME' to search in an array with users.
'@CO' to search in an array with contacts
'@TA' to search in an array with taks
How can I achieve this?
Thx
Frederik
any update please?
Hi Frederik Gysel,
Query 1 : Mention control not working as expected (with allowSpaces=true)
We apologize for any inconvenience caused. Upon reviewing your concern, we would like to inform you that the "mentionChar" property in the Mention component is designed to accept a single character or symbol as the mention trigger. In your case, please make sure to provide a single character as the value for the "mentionChar" property.
If you wish to display "@ME" in front of the mentioned value, you can utilize the display template feature. By customizing the display template, you can achieve the desired output. We have prepared a sample to demonstrate this functionality, which you can access using the bellow link:
Sample: https://stackblitz.com/edit/js-t6xcuc?file=index.js
Documentation: https://ej2.syncfusion.com/documentation/api/mention/#mentionchar
Query 2: How to use different mention strings to search in different arrays
We would like to inform you that the "mentionChar" property only accept a single character or symbol as the mention trigger. Kindly refer the bellow sample.
Sample: https://stackblitz.com/edit/xxbol3-lrgyg5?file=index.js,index.html,package.json
Demo : https://ej2.syncfusion.com/javascript/demos/#/bootstrap5/mention/multiple-list.html
If you encounter any issues or have further questions, Kindly let us know.
Regards,
Kokila Poovendran.
ok thanks for the feedback
Rgds
Frederik
- 4 Replies
- 2 Participants
-
FG Frederik Gysel
- Jun 19, 2023 07:44 PM UTC
- Jul 28, 2023 11:53 AM UTC