Override the link right click in rich text editor

Is it possible to override the default behaviour when the user right-clicks a link in the RTE? Or at least create a custom link toolbar menu item that will allow me to pop my own link editor? We need the user to be able to select links from a database instead of inserting a link manually.


1 Reply

VY Vinothkumar Yuvaraj Syncfusion Team October 15, 2024 02:41 PM UTC

Hi Peter Terkildsen,


We have validated your reported query and confirmed that there is a custom toolbar option in the Rich Text Editor for adding a custom toolbar. We have achieved your requirement by displaying a dialog component when the custom toolbar button is clicked. Inside the dialog, we have rendered the SfDropDownList component, and based on the dropdown selection, we update the link in the Rich Text Editor using the ExecuteCommandAsync method.

Please refer to the following video and attached sample for your reference.


Video:



Dialog Documentation:

https://blazor.syncfusion.com/documentation/dialog/getting-started-with-web-app

Rich Text Editor Documentation:
https://blazor.syncfusion.com/documentation/rich-text-editor/exec-command
https://blazor.syncfusion.com/documentation/rich-text-editor/tools/custom-tool

DropDownList Documentation:
https://blazor.syncfusion.com/documentation/dropdown-list/getting-started-with-web-app

API Link:
https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.SfRichTextEditor.html#Syncfusion_Blazor_RichTextEditor_SfRichTextEditor_ExecuteCommandAsync_Syncfusion_Blazor_RichTextEditor_CommandName_


Regards,
Vinothkumar


Attachment: BlazorApp1_(2)_957eb342_eedb6429.zip

Loader.
Up arrow icon