Get updated html with high SaveInterval

Hi!
Is there any way of getting the current HTML content of the RTE when using a high SaveInterval?
We want to "send" the form on CTRL-Enter, so we intercept that and submit - but the "Value" is not changed yet, and _editor.GetXhtmlAsync() does not return the updated value, just what was last saved.

Do you have any recommended ways of getting the current HTML?
I found an old post from 2021 about using the following, but that does not seem to work anymore, as blazor__instance is undefined.

window.RichTextEditor = { 
    getValue: function (id) {         
        var rteInstance = document.getElementById(id).blazor__instance; 
        // Retrieve the current Rich Text Editor value. 
        return rteInstance.getInputInnerHtml(); 
    } 
} 

I'm able to get it by doing the following, but wondered if there was a better way that might not break so easily if you change something :)

export function getHtml(elementId) {
    const editable = elementId?.querySelector(".e-rte-content .e-content");

    if (!editable) return '';

    const content = editable.innerHTML;
    return content;
}

1 Reply

VJ Vinitha Jeyakumar Syncfusion Team October 10, 2025 06:34 AM UTC

Hi Kristian Bleken,

Please note that when a high value is set for the SaveInterval property in the RichTextEditor, the ValueChange event may not be triggered immediately. As a result, the most recent content might not be available at the time of retrieval.

If you need to access the updated value before the ValueChange event fires, you can manually retrieve the content by accessing the HTML value of the contentEditable div—just as you've attempted. This approach ensures you're working with the latest content even when the event hasn't yet been triggered.


Regards,
Vinitha

Loader.
Up arrow icon