Ask Mention Support

Hello i wonder that have syncfusion team implemented mention feature for document editor like in rich text editor yet. At the moment, i need this feature, but from what i read from official docs, it's not available. Or if you have any alternative way in your library, suggest me. I really need the mention feature for document editor component


4 Replies

KM Kavitha Muralitharan Syncfusion Team August 16, 2023 04:47 PM UTC

Hi Phong,


Currently we are checking the scenario and will update the details by 18 August, 2023.


Regards,

Kavitha M




KM Kavitha Muralitharan Syncfusion Team August 21, 2023 09:08 AM UTC

Hi Phong,


The document editor provides a keydown event which will be triggered every time a key is pressed in the editor.

You can find more information about it here: https://ej2.syncfusion.com/react/documentation/api/document-editor/#keydown 

Using this event, we can detect the "@" key and display the EJ2 autocomplete component inside the EJ2 dialog to show a list of suggestions. Once an item is typed in the autocomplete element, you can choose the item from the suggestion list.

Once an item is selected, we can insert it into the editor using the insertText API of the editor module.

You can find more information about the insertText API here: https://ej2.syncfusion.com/react/documentation/api/document-editor/editor/#inserttext 

For your reference, we have prepared a sample. Please check the stackblitz link below and let us know if you have any concerns.

Stackblitz Link: https://stackblitz.com/edit/react-jjxniz-mbrt6f?file=index.js 

As mentioned in the above sample, we have bound the keydown event of the document editor to the functionality of showing the dialog inside the autocomplete component. The selected item in the autocomplete element will be inserted as text in the document editor.

Please check it and let us know if this meets your needs.

Regards,
Kavitha M



PK Praveen Kulkarni replied to Kavitha Muralitharan January 15, 2025 11:09 AM UTC

It is not user friendly to show popup box, user feel he is out of document , we need mentioned feature in document Editor like you have in rich text editor,



MA Mohammed Affan Saqib Hussain Syncfusion Team January 17, 2025 12:04 PM UTC

Hi Phong Nguyentien,

The Document Editor does not support mentions within the document itself. Mentions are only supported in the comments section of the Document Editor.

Demo Sample - https://ej2.syncfusion.com/react/demos/#/fluent2/document-editor/comments

Regards,

Mohammed Affan C


Loader.
Up arrow icon