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

Grid+RichTextEditor : rich text editor does not show value when first set up #4551

Closed
enver-haase opened this issue Jan 17, 2023 · 1 comment · Fixed by vaadin/web-components#6871

Comments

@enver-haase
Copy link
Contributor

Description

Please see attached minimal reproducible example. Only when I click the button can I see the text content of the RichTextEditor grid cells.

Expected outcome

I would think the editor should show the content immediately, not only when refreshed though a button click.

Minimal reproducible example

package com.example.application.views.main;

import com.vaadin.flow.component.button.Button;
import com.vaadin.flow.component.grid.Grid;
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
import com.vaadin.flow.component.richtexteditor.RichTextEditor;
import com.vaadin.flow.router.PageTitle;
import com.vaadin.flow.router.Route;

@PageTitle("Main")
@Route(value = "")
public class MainView extends HorizontalLayout {
    public MainView() {

        Grid<Integer> grid=new Grid<>();
        grid.addColumn(Object::toString).setHeader("I");
        grid.addComponentColumn(i -> {
            RichTextEditor rte = new RichTextEditor();
            rte.asHtml().setValue("<h1>"+i.toString()+"</h1>");

            rte.setReadOnly(true);
            return rte;
        }).setHeader("Text");
        Integer[] issss= {1,2,3,4,5};
        grid.setItems(issss);

        Button button = new Button("Click me to work around display bug", e -> {
            Integer[] foo = {1,2,3,4,5};
            grid.setItems(foo);
        });


        add(grid, button);
    }
}

Steps to reproduce

Use code above as a view, enjoy.

Environment

Vaadin version(s): 23.3.4
OS: macOS latest

Browsers

Chrome, Firefox

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants