Description
When a RichTextEditor has its value set programmatically and uses ValueChangeMode.LAZY or ValueChangeMode.TIMEOUT, it fires an unexpected intermediate value change event with <p></p> on initial load — before any user interaction. This occurs with both the classic ValueChangeListener API and the newer Signals API.
When the initial value is programmatically set to <p>hello world</p>, the sequence is:
<p>hello world</p> → <p></p> → <p>hello world</p>
Expected outcome
I would not expect any events until I actually start changing the value.
Minimal reproducible example
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.component.richtexteditor.RichTextEditor;
import com.vaadin.flow.data.value.ValueChangeMode;
import com.vaadin.flow.router.Route;
import com.vaadin.flow.signals.impl.Effect;
import com.vaadin.flow.signals.local.ValueSignal;
@Route("")
public class SignalView extends VerticalLayout {
private final ValueSignal<String> signal = new ValueSignal<>("<p>hello world</p>");
public SignalView() {
var rte = new RichTextEditor();
rte.setValueChangeMode(ValueChangeMode.LAZY);
rte.bindValue(signal, signal::set);
Effect.effect(this, () -> {
System.out.println("Signal value: " + signal.get());
});
add(rte);
}
}
Steps to reproduce
- Create a new empty application at start.vaadin.com, using Vaadin 25.1 (pre).
- Add the above view to the application and start it.
- Navigate to the view without editing the text in the editor at all.
- Observe the console output.
Environment
Vaadin version(s): 25.1.0-alpha9
OS: macOS 26.3
Browsers
Chrome
Description
When a
RichTextEditorhas its value set programmatically and usesValueChangeMode.LAZYorValueChangeMode.TIMEOUT, it fires an unexpected intermediate value change event with<p></p>on initial load — before any user interaction. This occurs with both the classicValueChangeListenerAPI and the newer Signals API.When the initial value is programmatically set to
<p>hello world</p>, the sequence is:Expected outcome
I would not expect any events until I actually start changing the value.
Minimal reproducible example
Steps to reproduce
Environment
Vaadin version(s): 25.1.0-alpha9
OS: macOS 26.3
Browsers
Chrome