jmix icon indicating copy to clipboard operation
jmix copied to clipboard

RichTextEditor displayed in dialog has no formatting

Open glebfox opened this issue 1 year ago • 2 comments

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

glebfox avatar Apr 18 '24 11:04 glebfox

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

gorbunkov avatar Apr 19 '24 06:04 gorbunkov

Jmix 2.3, FireFox 126.0.1 still reproduces

glebfox avatar Jun 11 '24 07:06 glebfox

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.

glebfox avatar Aug 15 '24 14:08 glebfox