How set Html in Rich Text Editor

I see in the new version of Rich Text Editor (1.1.0) it’s possible to set an html value instead the Delta format.

but how do i do it? doesn’t have a specific method and when using setValue doesn’t work

tks

RichTextEditor.setValue(delta) and RichTextEditor.getValue() still handle Delta format. To work with HTML you need to call RichTextEditor.asHtml(), i.e. RichTextEditor.asHtml().setValue(html) and RichTextEditor.asHtml().getValue()

On a related note, I have found an issue with setting html on a disabled or readonly RichTextEditor. So I’m just gonna hijack this thread for my question…

Having

RichTextEditor rte = new RichTextEditor();
rte.setEnabled(false);
rte.asHtml().setValue("Hello");

doesn’t work because dangerouslySetHtmlValue calls setContents(deltaFromHtml, SOURCE.USER) and from Quill’s docs for setContents: “Calls where the source is “user” when the editor is disabled are ignored.”

Even first setting the value and then calling disable on RichTextEditor doesn’t work because setting an html value happens asynchronously.

Could you explain, why it is necessary to have setContents be called with SOURCE.USER? Or how I could circumvent this issue?