-
Notifications
You must be signed in to change notification settings - Fork 93
Open
Labels
Description
Description
Unlike other components e.g. vaadin-badge, in vaadin-card the approach for _c attribute assumes an element, so the attribute isn't set if the content is a text node (e.g. Text component in Flow).
| this.toggleAttribute('_c', this.querySelector(':scope > :not([slot])')); |
This is problematic especially for add(String text) method in Java - see vaadin/docs#5247
Expected outcome
I would expect the _c attribute to be set if there is a non-empty text node, using e.g. SlotController.
Minimal reproducible example
<vaadin-card>
This text should be visible!
</vaadin-card>Steps to reproduce
Add the snippet to the dev page and observe an empty card.
Environment
Vaadin version(s): 24.x, 25.x
Browsers
Issue is not browser related
Reactions are currently unavailable