We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

SfRichTextEditor trigger EditContext.OnFieldChanged

In an EditForm which contains an EditContext to follow the change made on the model, if you click on a button of the EditForm which contains SfRichTextEditor, the SfRichTextEditor is detected that it has been changed


In the attached example, I bound the SfRichTextEditor component with the Comment property.

if I click on a button of the EditForm the OnFieldChanged event is triggered to say that the comment property has been modified (its value is always Null).


Attachment: Test_ab78365b.zip

5 Replies

SA SAID AZOUZ February 21, 2023 11:32 AM UTC

The problem is reproducible only if the property is Null



VJ Vinitha Jeyakumar Syncfusion Team February 22, 2023 03:37 PM UTC

Hi SAID,

Your reported issue can be resolved by initiating the RichTextEditor value with empty string value or string.Empty. Please check the code below,

Code snippet:
<EditForm EditContext="@EditContext">
      <h3>Test SfRichText</h3>
      <div class="row">
            <label>Name</label>
            <InputText @bind-Value="customer.Name"></InputText>
      </div>
      <SfRichTextEditor @bind-Value="customer.Comment"></SfRichTextEditor>
<button class="btn btn-primary" @onclick="click">Test</button>
</EditForm>

public class Customer
      {
            public int Id { get; set; }
            public string Name { get; set; }
            public string Comment { get; set; } = string.Empty;
      }

Please let us know if you have any concerns.

Regards,
Vinitha


SA SAID AZOUZ replied to Vinitha Jeyakumar February 22, 2023 03:56 PM UTC

Hi Vinitha, 


Thank you for your reply.

yes I know this workaround well, but I already have objects in the database, so I have to change everything I have to make it work for them too.


Thanks again.





VJ Vinitha Jeyakumar Syncfusion Team February 24, 2023 04:51 AM UTC

Hi SAID,


We have considered the reported issue "EditForm ValueChanged event got triggered initially, when we initialize the RichTextEditor value as null" as a bug from our end and the fix for the issue will be included with our upcoming Vol 1 2023 release

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




VY Vinothkumar Yuvaraj Syncfusion Team March 28, 2023 01:59 PM UTC

Hi SAID,


We have included the fix for the issue "EditForm ValueChanged event got triggered initially, when we initialize the RichTextEditor value as null" with our package version 20.4.53. So, can you please upgrade your package to the latest to resolve the issue from your end.


Release noteshttps://blazor.syncfusion.com/documentation/release-notes/20.4.53?type=all#richtexteditor

Regards,

Vinothkumar


Loader.
Live Chat Icon For mobile
Up arrow icon