Rich text editor ValueChange does not trigger when in Code view

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 },
    };
}


4 Replies

VJ Vinitha Jeyakumar Syncfusion Team January 5, 2024 10:30 AM UTC

Hi Marian Tarpescu

We have considered the reported issue "ValueChange event not triggered when we edit in Code view in RichTextEditor " as a bug from our end and the fix for the issue will be included with our upcoming patch release on 16th January 2024.

Now you can track the status of the reported issue through the feedback below,

Disclaimer: “Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization.”

Regards,
Vinitha


VJ Vinitha Jeyakumar Syncfusion Team February 26, 2024 07:00 AM UTC

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


Regards,
Vinitha


MT Marian Tarpescu March 8, 2024 12:43 PM UTC

Hello  Vinitha Jeyakumar

Thank you for the update, we'll have a look as soon as possible.



VY Vinothkumar Yuvaraj Syncfusion Team March 11, 2024 06:24 AM UTC

Hi Marian,


Thanks for an update.

Please check this on your end. If you have any further queries, kindly get back to us.


Loader.
Up arrow icon