Hi Ivan,
Greetings from Syncfusion support.
We have validated your query “Is there any nice way to get the current value only when I need it? I am using CircuitHandlerService to attach logic on browser refresh but when I get the Value property of the RTE object it is not the current value but the previously saved one”.
The Rich Text Editor value can be get using the `Value` API which is a two-way binding property, but not using the Rich Text Editor’s object. The value should be assigned to a variable and the `@bind` should be used to reflect the Rich Text Editor value in the variable as it is a two-way binding property. We have prepared a sample to get the Rich Text Editor value when ever needed,
Code Snippet:
|
<SfRichTextEditor @ref="defaultAPIObj" @bind-Value="@RteValue" /> |
|
private string RteValue = @"<p>Rich Text Editor is a WYSIWYG editing control which will reduce the effort for users while trying to express their formatting word content as HTML or Markdown format.</p><p><b>API’s:</b></p><ul><li><p>MaxLength - allows to restrict the maximum length to be entered.</p></li><li><p>ReadOnly - allows to change it as non-editable state.</p></li><li><p>Enabled - enable or disable the RTE component.</p></li><li><p>EnableHtmlEncode - Get the encoded string value through value property and source code panel</p></li><li><p>GetValue - get the value of RTE.</p></li></ul>";
private async Task GetValueClick()
{
this.Content = this.RteValue;
await this.DialogObj.Show();
} |
Please check the above code snippet, documentation and the sample and let us know if it satisfy your requirement.
Regards,
Revanth