Hello Syncfusion,
We just stumbled over a very peculiar bug with the Rich Text Editor Component.
It seems like the ValueChange Event does not trigger if you are using the code view.
Steps to reproduce 1.Configure this code into a new page 2.Write something in the RTE 3.Notice how the value changes 4.Switch RTE to Code Mode 5.Make some changes 6.Notice how the value does not change anymore
Please have a look at the code below
@using Syncfusion.Blazor.RichTextEditor
<div>
<SfRichTextEditor @ref="_richTextEditorObj" ID="@Id"
Placeholder="@Placeholder" @bind-Value="CurrentValue"
ShowCharCount="true" SaveInterval="1" AutoSaveOnIdle="true" EnableHtmlSanitizer>
<RichTextEditorToolbarSettings Items="@_toolbarActions" Type="ToolbarType.Expand" />
<RichTextEditorEvents ValueChange="@OnValueChanged" />
</SfRichTextEditor>
</div>
<div>
Value changed @_valueChanges times
</div>
@code {
private SfRichTextEditor _richTextEditorObj { get; set; }
private string Id = "customValue1";
private string Placeholder = "Please insert some text";
private void OnValueChanged(Syncfusion.Blazor.RichTextEditor.ChangeEventArgs e)
{
Console.WriteLine($"Value changed on RTE:{e.Value.ToString()}");
_valueChanges++;
}
private int _valueChanges { get; set; } = 0;
private string CurrentValue { get; set; }
private List<ToolbarItemModel> _toolbarActions = new List<ToolbarItemModel>()
{
new ToolbarItemModel() { Command = ToolbarCommand.Undo },
new ToolbarItemModel() { Command = ToolbarCommand.Redo },
new ToolbarItemModel() { Command = ToolbarCommand.Separator },
new ToolbarItemModel() { Command = ToolbarCommand.Bold },
new ToolbarItemModel() { Command = ToolbarCommand.Italic },
new ToolbarItemModel() { Command = ToolbarCommand.LowerCase },
new ToolbarItemModel() { Command = ToolbarCommand.UpperCase },
new ToolbarItemModel() { Command = ToolbarCommand.Separator },
new ToolbarItemModel() { Command = ToolbarCommand.Alignments },
new ToolbarItemModel() { Command = ToolbarCommand.NumberFormatList },
new ToolbarItemModel() { Command = ToolbarCommand.BulletFormatList },
new ToolbarItemModel() { Command = ToolbarCommand.Outdent },
new ToolbarItemModel() { Command = ToolbarCommand.Indent },
new ToolbarItemModel() { Command = ToolbarCommand.Separator },
new ToolbarItemModel() { Command = ToolbarCommand.CreateLink },
new ToolbarItemModel() { Command = ToolbarCommand.SourceCode },
new ToolbarItemModel() { Command = ToolbarCommand.FullScreen },
};
}
Hi Marian Tarpescu,
We have included the fix for the reported issue "ValueChange event not triggered when we edit in Code view in RichTextEditor" with our patch release version 24.1.46. So please upgrade your package to the latest to resolve the issue from your end.
Release Notes: https://blazor.syncfusion.com/documentation/release-notes/24.1.46?type=all#rich-text-editor
Hello
Vinitha Jeyakumar
Thank you for the update, we'll have a look as soon as possible.
Hi Marian,
Thanks for an update.
Please check this on your end. If you have any further queries, kindly get back to us.