Skip to content

refactor: use SlotObserver for card slot content detection #11209

Open
web-padawan wants to merge 1 commit intomainfrom
fix/card-observers
Open

refactor: use SlotObserver for card slot content detection #11209
web-padawan wants to merge 1 commit intomainfrom
fix/card-observers

Conversation

@web-padawan
Copy link
Member

Description

Depends on #11208

Fixes #11207

Updated vaadin-card to use SlotObserver instead of slotchange event and querySelector() calls.

Type of change

  • Bugfix

Replace the blanket slotchange listener and querySelector-based detection
with individual SlotObserver instances per slot. Introduce CardSlotObserver
helper that extends SlotObserver to toggle host attributes based on slotted
content presence, filtering out empty text nodes and shadow DOM fallback
content. Add snapshot test for text node content in the default slot.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@web-padawan web-padawan marked this pull request as ready for review February 27, 2026 10:41
@sonarqubecloud
Copy link

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[card] Text node not shown when passed into default slot

1 participant