Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rich Text Editor inside Dialog, cannot unselect toolbar buttons #7543

Closed
paodb opened this issue Jul 11, 2024 · 1 comment · Fixed by #7558
Closed

Rich Text Editor inside Dialog, cannot unselect toolbar buttons #7543

paodb opened this issue Jul 11, 2024 · 1 comment · Fixed by #7558
Assignees
Labels
BFP Bug fix prioritised by a customer vaadin-rich-text-editor

Comments

@paodb
Copy link
Collaborator

paodb commented Jul 11, 2024

Description

When using Rich Text Editor component inside a Dialog in Vaadin 24.4.6, once you enable a toolbar button like bold, italic, etc, they cannot be unselect. See recording:

rich-text-editor-dialog

This only happens when the Rich Text Editor component is inside a Dialog. If no Dialog is involved, unselecting the buttons works as expected.

Expected outcome

Be able to unselect toolbar buttons.

Minimal reproducible example

RichTextEditor rte = new RichTextEditor();
rte.setWidth("400px");

Dialog dialog = new Dialog("My dialog");        
dialog.add(rte);

add(new Button("open dialog", e -> dialog.open()));

Steps to reproduce

1 - Add the snippet above in a view in a Vaadin 24.4.6 application and run it.
2 - Open the dialog and in the Rich Text Editor, enable bold option (or italic, underline etc.).
3 - Then try to unselect the enabled option and see you're unable to do so like in attached recording.

Environment

Vaadin version(s): 24.4.6

Browsers

Chrome, Firefox

@web-padawan web-padawan added BFP Bug fix prioritised by a customer vaadin-rich-text-editor labels Jul 12, 2024
@web-padawan
Copy link
Member

web-padawan commented Jul 12, 2024

Confirmed. The issue only can be reproduced in Flow counterpart, the web component works fine. I will investigate this.

UPD: can be also reproduced in the web component after closing the dialog and re-opening it. The reason is that Quill instance gets re-initialized (since #6506) and then there are multiple click listeners added for each toolbar button.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BFP Bug fix prioritised by a customer vaadin-rich-text-editor
Projects
None yet
2 participants