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;
}