jmix-framework / jmix

Jmix framework
https://www.jmix.io
Apache License 2.0
562 stars 118 forks source link

RichTextEditor displayed in dialog has no formatting #3169

Open glebfox opened 4 months ago

glebfox commented 4 months ago

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

Screenshot 2024-04-18 at 15 15 15

Expected Behavior

Screenshot 2024-04-18 at 15 15 34
gorbunkov commented 4 months ago

Not a major problem. We'll wait a fix from Vaadin.

glebfox commented 3 months ago

Jmix 2.3, FireFox 126.0.1 still reproduces

glebfox commented 4 weeks ago

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.