RTE Strange refresh issue when existing, need help isolating

Hi, I am having a very strange issue using the Rich Text Editor control in my blazor app (v 29.1.41). 

When I click outside the editor, it is briefly disappearing and then reappearing.

I do have the control inside an AuthorizeView with a custom policy, and guessed that was it, but when I tried to recreate that scenario in a blank project, it is working fine, so that's probably not it....

But I'm not sure what it could be. So I recorded a video of the problem you can review here:  blazorrte.mp4

In the first version, I'm in the blank project, and I'm clicking on the right after each edit and you can see it's fine.

On the next tab, which is my project, when I click outside the editor you can see it briefly flashes, and the undo history is lost, like it's completely refreshing.

I'm not sure why, because I have the exact same markup and binding on the sample project, and both are inside AuthorizeView switchers, but only mine is refreshing...

I would share the site to reproduce this live, but it's behind a login. I'm happy to share that, if you would be able to login and see it for yourself, but i unfortunately can't reproduce it...

I'm hoping perhaps this is a familiar issue, and maybe you can suggest something else to check? this is hindering usage of the page, so I'd sure like to get this resolved as it's blocking my release of this update for this feature!

please let me know what else I can share to help pinpoint the issue, and many thanks!

joshm


3 Replies

JD Josh D Morales May 14, 2025 03:20 AM UTC

aha okay I was able to reproduce this after all (turns out I didn't register the policy correctly)


and it DOES appear to be due to the authorization, which is doing a remote call to check the status.

When this happens, the control disappears entirely. 

I'm guessing tho that this is the expected behavior, and there isn't anything I can do about it, can you confirm? because it's weird that just editing the control would force a full refresh of the policy, and i'm not sure it's because of the way the control is implemented or the way blazor works in general...

either way I attached a sample project anyway reproducing the problem, if nothing else, in case someone else is searching for the similar problem.

My plan is to process the policy external to this control and bind it on page load, that way it doesn't have to keep checking it.

but if there's a better way to make this work, or a fix on your side that will resolve this, that'd be great, let me know if I can provide any further information, thanks!


Attachment: blazorRTE_ad94818b.zip


VJ Vinitha Jeyakumar Syncfusion Team May 14, 2025 11:14 AM UTC


Hi Josh D Morales,



We have considered the reported issue "RichTextEditor Refreshes on Focus Out When Used Inside AuthorizeView" as a bug from our end, and the fix for the issue will be included with our upcoming patch release in the first week of June 2025

 

Regards,
Vinitha




VJ Vinitha Jeyakumar Syncfusion Team May 22, 2025 11:39 AM UTC

Hi Josh D Morales,


Upon further validation of the reported issue, we found that the RichTextEditor refreshes on focus out when used inside an AuthorizeView. The root cause is the use of the @bind-Value property, which triggers a re-render of the component.


We confirmed this behavior by testing a native <textarea> with @bind and observed the same result. Therefore, this is not an issue with the RichTextEditor itself.

Additionally, the <AuthorizeView> component in Blazor conditionally renders its child content based on the user's authentication state. If the authentication state changes, the content within <AuthorizeView> is re-rendered, which can also contribute to this behavior.

Regards,
Vinitha

Loader.
Up arrow icon