jmix
jmix copied to clipboard
RichTextEditor displayed in dialog has no formatting
Environment
Jmix version: 2.2.1 Browser: FireFox 125.0.1
Bug Description
RichTextEditor displayed in the dialog has no formatting.
Note: Reproduced in FireFox only.
Steps To Reproduce
JmixRichTextEditor rte = uiComponents.create(JmixRichTextEditor.class);
rte.addThemeVariants(RichTextEditorVariant.COMPACT);
rte.setReadOnly(true);
rte.setLabel("Field:");
rte.setValue("<h1>test</h1><p>123</p><p>test</p>");
rte.setWidthFull();
rte.setHeight("20em");
dialogs.createMessageDialog()
.withHeader("Test RichTextEditor ")
.withContent(layout)
.open();
Current Behavior
Expected Behavior
Not a major problem. We'll wait a fix from Vaadin.
Jmix 2.3, FireFox 126.0.1 still reproduces
QuillJs stores its value as Delta (JSON describing formatting). To convert HTML to Delta, we use QuillJs clipboard.convert function, i.e. we simulate the situation when the user pastes a value into the editor. It seems that this is a Quill problem as it has a lot copy-paste issues. Even inconsistent behaviour between Chrome and Firefox.