Skip to content

fix: keep custom card title intact when removed and added again - #13157

Closed
web-padawan wants to merge 3 commits into
mainfrom
fix/card-title-readd
Closed

web-padawan wants to merge 3 commits into
mainfrom
fix/card-title-readd

Conversation

@web-padawan

@web-padawan web-padawan commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Description

Depends on #13151

  • Fixed removing a custom slot="title" element clearing its text content and adding aria-level to it
  • Fixed adding the same custom title element back being ignored, which left the card title empty
    • Flow hits this when a view clears a card and sets the same title component again
  • Added tests for removing a custom title, and for removing and adding it again

Type of change

  • Bugfix

How to test

  1. Open dev/card.html
  2. Under "Header & Footer", check "Title"
  3. In the browser console, run const card = document.querySelector('vaadin-card.playground'); const title = card.querySelector('[slot="title"]'); title.remove();
  4. Check that title.textContent is still "Lapland" and title has no aria-level attribute
  5. Run card.append(title)
  6. The "Lapland" title shows in the card again

🤖 Generated with Claude Code

web-padawan and others added 3 commits October 16, 2026 12:17
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

Base automatically changed from test/card-title-nested-fixtures to main October 16, 2026 11:06
@web-padawan

Copy link
Copy Markdown
Member Author

Closing in favor of #13158.

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.

1 participant