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 (

allowSpaces: true,

) is not working?


Thx for checking

Frederik


4 Replies

FG Frederik Gysel June 21, 2023 07:57 AM UTC

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



FG Frederik Gysel June 23, 2023 09:36 AM UTC

any update please?



KP Kokila Poovendran Syncfusion Team July 10, 2023 01:57 PM UTC

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:


Samplehttps://stackblitz.com/edit/js-t6xcuc?file=index.js

Documentationhttps://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.


Samplehttps://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.




FG Frederik Gysel July 28, 2023 11:53 AM UTC

ok thanks for the feedback


Rgds

Frederik


Loader.
Up arrow icon