problem with RadRichTextEditor (especially UI)

2 Answers 74 Views
RichTextEditor
hyunkyoo
Top achievements
Rank 1
hyunkyoo asked on 17 Mar 2024, 08:44 AM | edited on 17 Mar 2024, 12:05 PM

Dear Telerik team,

I was trying to bind "Source" and "data for HTML string" of "RadRichTextEditor" but, when I tried to change the bound value to another value, it was not updated on UI.

I debugged code of RadRichTextEditor of Telerik and the second condition "IsDocumentLoaded" of OnSourcePropertyChanged() has to become "true" but, it's not "true" and I assume that this cause problem as below code.

private async void OnSourcePropertyChanged(RichTextSource richTextSource)
{
if (richTextSource == null)
;
else if (!this.IsDocumentLoaded)
;
else
{
string htmlText = await this.GetHtmlAsync(richTextSource);
this.dispatchHandler.InvokeOnMainThread((Action) (async () =>
{
await this.richTextView.SetHtmlAsync(htmlText);
await this.richTextView.ClearHistoryAsync();
}));
this.dispatchHandler.InvokeOnMainThread((Action) (async () => await this.richTextView.ScrollToPositionAsync(0.0, 0.0)));
}
}

 

I believe that the data(IsDocumentLoaded) is updated when "document-loaded"message come to RichTextView.

private void OnDocumentLoaded(object sender, EventArgs eventArgs)
{
this.IsDocumentLoaded = true;
this.UpdateDefaultValues();
this.UpdateContentSize();
this.UpdateCommandState();
}

 

Would you please check this problem and improve it so the bound data can be updated and shown to UI correctly whenever I change the HTML string data?

 

 

 

2 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 18 Mar 2024, 09:09 AM

Hello Hyunkyoo,

I've just checked the described scenario with binding the RichTextEditor's Source property and it's properly updated on my side. I've attached my test app, can you modify it with any additional code you might have, so that the issue to be reproduced and send it back for further research?

I look forward to your reply.

Regards,
Yana
Progress Telerik

A brand new ThemeBuilder course was just added to the Virtual Classroom. The training course was designed to help you get started with ThemeBuilder for styling Telerik and Kendo UI components for your applications. You can check it out at https://learn.telerik.com
hyunkyoo
Top achievements
Rank 1
commented on 18 Mar 2024, 01:18 PM

Hello Yana,

Thanks for checking the problem.

I attached file which is code I modified you sent me.

Please check it.


0
Yana
Telerik team
answered on 21 Mar 2024, 10:01 AM

Hello Hyunkyoo,

Thank you for updating the app and demonstrating the issue at hand.

It seems you stumbled upon the following issue related to the RichTextEditor:

RichTextEditor: Document unloaded after navigating to new page

The representation is different, as in the scenario you have, the RichTextEditor is placed in a popup, still, the reason behind is the same - the control is unloaded which leads to the initialization issues.

I've updated the priority of the issue per your report.  For the time being, the only workaround is to create a new instance of the RichTextEditor when the popup is re-open.

I am sorry for any inconvenience caused.

Regards,
Yana
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

hyunkyoo
Top achievements
Rank 1
commented on 22 Mar 2024, 11:13 AM

Hello Yana,

 

Thank you for you support on this matter.

Have a nice weekend.

Tags
RichTextEditor
Asked by
hyunkyoo
Top achievements
Rank 1
Answers by
Yana
Telerik team
Share this question
or