web-components icon indicating copy to clipboard operation
web-components copied to clipboard

Button with Theme tertiary-inline too small in flexbox

Open stefanbrenner opened this issue 3 years ago • 2 comments

Buttons with the ButtonVariant.LUMO_TERTIARY_INLINE are too small if they are placed inside of an flexbox.

    Div flexbox = new Div();
    flexbox.getStyle().set("display", "flex");
    flexbox.getStyle().set("flex-flow", "row nowrap");
    add(flexbox);

    TextField tf = new TextField();
    tf.setWidthFull();

    Button b1 = new Button();
    b1.setIcon(VaadinIcon.USER.create());
    b1.addThemeVariants(ButtonVariant.LUMO_TERTIARY_INLINE);
    b1.getStyle().set("outline", "auto");

    Button b2 = new Button();
    b2.setIcon(VaadinIcon.USER.create());
    b2.addThemeVariants(ButtonVariant.LUMO_TERTIARY_INLINE);
    b2.getStyle().set("outline", "auto");

    flexbox.add(tf, b1, b2);

I expect the ouline of the two buttons to be rectangular and not 'clipped':

Screenshot 2022-03-15 at 16 33 55

I think the problem is min-width: 0 at the vaadin-button. If I change it to auto it works:

:host([theme~='tertiary-inline']) {
    min-width: auto;
}

Screenshot 2022-03-15 at 16 34 10

stefanbrenner avatar Mar 15 '22 15:03 stefanbrenner

@jouni The suggested solution might be a good alternative to min-width: 0. What do you think?

vursen avatar Mar 29 '22 11:03 vursen

Yeah, sounds good to me.

jouni avatar Mar 29 '22 12:03 jouni