Description of the bug
The behavior for the badge component changed in patch release 25.2.7.
With 25.2.6 the text was shown.
With 25.2.7 the text is no longer shown.
The reason seems to be that the attribute has-content is no longer present in the dom with 25.2.7, but was in 25.2.6
This leads to the following css rule to become active:
:host(:not([has-icon])) [part="icon"], :host(:not([has-content])) [part="content"], :host(:not([has-number])) [part="number"] {
display: none;
}
This is maybe a regression in vaadin/web-components@ac3ff22?
The simplest fix for now seems to be to manually add the attribute ourselves.
badge.getElement().callJsFunction("setAttribute", "has-content", "");
Weirdly it does not work with the following API. Vaadin seems to run some code later to remove the attribute again.
badge.getElement().setAttribute("has-content", "");
Expected behavior
The badge component should always show the text, no matter the Vaadin version.
Minimal reproducible example
@Route
public class MainView extends VerticalLayout {
public MainView() {
add(new Badge("Hello World"));
}
}
25.2.6:

25.2.7:

Versions
- Vaadin / Flow version: 25.2.7 (The newest Vaadin Version seems to be 25.2.7, but the newest Flow version seems to be 25.2.9, but I have no Idea what Flow version is used with Vaadin 25.2.7)
- Java version: not relevant
- OS version: not relevant
Description of the bug
The behavior for the badge component changed in patch release
25.2.7.With
25.2.6the text was shown.With
25.2.7the text is no longer shown.The reason seems to be that the attribute
has-contentis no longer present in the dom with25.2.7, but was in25.2.6This leads to the following css rule to become active:
This is maybe a regression in vaadin/web-components@ac3ff22?
The simplest fix for now seems to be to manually add the attribute ourselves.
Weirdly it does not work with the following API. Vaadin seems to run some code later to remove the attribute again.
Expected behavior
The badge component should always show the text, no matter the Vaadin version.
Minimal reproducible example
25.2.6:

25.2.7:

Versions