Has anyone encountered the following strange behavior with the TelerikEditor component? More specifically, I am referring to its ValueChange event as documented on Blazor Editor Events - Telerik UI for Blazor.
To try and reproduce the behaviour, use the following code example instead on the page's example:
<TelerikEditor Value="@TheEditorContent" ValueChanged="@ValueChangedHandler"></TelerikEditor> @TheEditorContent @code { string TheEditorContent { get; set; } = @"<div><p>Paragraph 1</p><p>Paragraph 2</p><p>Paragraph 3</p><p /><p /><p>Paragraph 4</p></div>"; void ValueChangedHandler(string value) { // update the view-model //TheEditorContent = value; Console.WriteLine("ValueChanged fired"); } }In this example, TheEditorContent string as been assigned a verbatim literal string containing CRLF formatting. The view-model update was commented out.
Compile and, hopefully, you'll confirm as I did that if you click or try to type on the editor, the console will infinitely loop over the ValueChangeHandler and print "ValueChanged fired" indefinitely. Furthermore, if you actually update the view-model, although the loop doesn't occur anymore, the ValueChanged event is fired upon cliking once on the editor. I assume that upon update, the editor changes the formatting of the input in such a way that this "bug" is not longer triggered on further clicks. Does anyone know why this happens?