Description
When using the value change modes lazy or timeout, it is not possible to set an initial delta value via asDelta().setValue(myDelta) . The RTE stays empty.
A workaround is to delegate the setting:
editor.getElement()
.executeJs("")
.then(_unused -> editor.asDelta().setValue(initialValue));
Expected outcome
All value change modes should work.
Minimal reproducible example
@Route("")
public class RteView extends VerticalLayout {
public RteView() {
var editor = new RichTextEditor();
editor.setValueChangeMode(ValueChangeMode.LAZY);
editor.asDelta().setValue("[" +
"{\"insert\":\"Stock \"}," +
"{\"insert\":\"RTE\",\"attributes\":{\"bold\":true}}," +
"{\"insert\":\" from Vaadin 25\\n" +
"This is the unmodified Vaadin Rich Text Editor for comparison.\\n\"}" +
"]");
}
}
Steps to reproduce
Download a starter, add the view and load the app. The RTE stays empty.
Remove the value change mode and it works.
Environment
Vaadin version(s): 25.0.6
OS: Kubuntu 25
Browsers
No response
Description
When using the value change modes
lazyortimeout, it is not possible to set an initial delta value viaasDelta().setValue(myDelta). The RTE stays empty.A workaround is to delegate the setting:
Expected outcome
All value change modes should work.
Minimal reproducible example
Steps to reproduce
Download a starter, add the view and load the app. The RTE stays empty.
Remove the value change mode and it works.
Environment
Vaadin version(s): 25.0.6
OS: Kubuntu 25
Browsers
No response