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

ContextMenu added component's theme variant is not honoured #2485

Closed
enver-haase opened this issue Jan 10, 2022 · 1 comment
Closed

ContextMenu added component's theme variant is not honoured #2485

enver-haase opened this issue Jan 10, 2022 · 1 comment

Comments

@enver-haase
Copy link
Contributor

Description

If I add two buttons to a context menu, both with a theme variant of LUMO_ERROR, then this is not shown at all;
however, if I wrap one button into a FlexLayout, it works.

I would like to make do without such a work-around.

Expected outcome

Theme variant is honoured, even without a button being wrapped in a FlexLayout.

Actual outcome

Unwrapped button does not show the LUMO_ERROR theme variant.

Live Demo (optional)

Screenshot 2022-01-10 at 11 36 21

Minimal reproducible example

 public AboutView() {
        setSpacing(false);

        Image img = new Image("images/empty-plant.png", "placeholder plant");
        img.setWidth("200px");
        add(img);

        add(new H2("This place intentionally left empty"));
        add(new Paragraph("It’s a place where you can grow your own UI 🤗"));

        setSizeFull();
        setJustifyContentMode(JustifyContentMode.CENTER);
        setDefaultHorizontalComponentAlignment(Alignment.CENTER);
        getStyle().set("text-align", "center");


        **ContextMenu contextMenu = new ContextMenu(img);
        Button button1 = new Button("Eins");
        button1.addThemeVariants(ButtonVariant.LUMO_ERROR);
        Button button2 = new Button("Zwei");
        button2.addThemeVariants(ButtonVariant.LUMO_ERROR);
        FlexLayout flexLayout = new FlexLayout(button2);

        contextMenu.add(button1, flexLayout);**
    }

-->

Steps to reproduce

See Vaadin Starter demo project, use above code.

Environment

  • Version of the component / Vaadin platform.

Vaadin 22.0.2

  • OS.

macOS, latest of 20220110

Browsers Affected

Chrome, probably all

@yuriy-fix yuriy-fix changed the title ContextMenu added component's theme variant is honoured ContextMenu added component's theme variant is not honoured Jan 11, 2022
@web-padawan
Copy link
Member

This is the same as #2559. Fixed by vaadin/web-components#3459 which land in the next v22 patch release.

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

No branches or pull requests

3 participants