Merge pull request #1848 from leigh-pointer/RichTextContentRefresh

Fix #1837 RichTextEditor Content not re-Rendering
This commit is contained in:
Shaun Walker 2021-12-03 09:45:59 -05:00 committed by GitHub
commit de798da074
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -120,19 +120,19 @@
new Resource { ResourceType = ResourceType.Script, Bundle = "Quill", Url = "js/quill-interop.js" }
};
protected override void OnInitialized()
protected override void OnParametersSet()
{
_content = Content; // raw HTML
}
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
var interop = new RichTextEditorInterop(JSRuntime);
if (firstRender)
{
await base.OnAfterRenderAsync(firstRender);
var interop = new RichTextEditorInterop(JSRuntime);
await interop.CreateEditor(
_editorElement,
_toolBar,
@ -140,14 +140,15 @@
Placeholder,
Theme,
DebugLevel);
await interop.LoadEditorContent(_editorElement, Content);
_content = Content; // raw HTML
// preserve a copy of the rich text content ( Quill sanitizes content so we need to retrieve it from the editor )
_original = await interop.GetHtml(_editorElement);
}
await interop.LoadEditorContent(_editorElement, Content);
_content = Content; // raw HTML
// preserve a copy of the rich text content ( Quill sanitizes content so we need to retrieve it from the editor )
_original = await interop.GetHtml(_editorElement);
}
public void CloseFileManager()