RadzenHtmlEditor - Insert at Cursor

Hi foolkz, is there a way to use the HtmlEditorCommands.InsertHtml to insert at the last known cursor location in the HTMLEditor?

When I use - await editor.ExecuteCommandAsync(HtmlEditorCommands.InsertHtml, "ExampleText"); it always inserts it at Position 0.

Our custom tools demo inserts at the cursor position.

insert-html

Inserting at position 0 would happen if the editor loses focus.

I am using a Dialog to allow the user to select some content to be inserted, so yes, the editor is losing focus.

Any thouggts on how i could rectify?

The linked demo contains an example with a dialog.

I have no idea how come I did not see that yesterday!
Thx!

Confirm that this fixed the issue.

Thx!

The second example "Custom tool with template" does not work as shown in above pictures. Currently, it is inserting at the start. How to get it working.

On a different note, why do I get this error on the website when I want to see source code - Cannot fetch the example source code: TypeError: Failed to fetch

Make sure your browser has access to https://raw.githubusercontent.com/radzenhq/radzen-blazor/master/RadzenBlazorDemos/Pages/HtmlEditorCustomToolExecute.razor