fix: keep BreadcrumbsItem prefix component when setting text#9534
Merged
Conversation
sissbruecker
approved these changes
Jun 17, 2026
HasText#setText replaced all of the item's content, removing the prefix component. Mirror Button and Badge: hold the text in a dedicated text node managed through SignalPropertySupport, so setText (and bindText) only updates the text node and leaves the prefix in place. Fixes #9533 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
web-padawan
force-pushed
the
fix/breadcrumbs-prefix-component
branch
from
June 17, 2026 07:58
880d88d to
490c6fa
Compare
|
ZheSun88
pushed a commit
that referenced
this pull request
Jun 17, 2026
`BreadcrumbsItem.setText` used the default `HasText#setText`, which
replaces all of the item's content — so calling it after
`setPrefixComponent` removed the prefix (e.g. an icon).
```java
BreadcrumbsItem item = new BreadcrumbsItem("Inbox (2 items)");
item.setPrefixComponent(new Icon(VaadinIcon.ENVELOPE));
item.setText("Inbox (3 items)"); // icon was lost
```
The text is now held in a dedicated text node managed through
`SignalPropertySupport`, the same approach `Button` and `Badge` use.
`setText`/`bindText` only update that text node, so the prefix (and any
other slotted content) is preserved.
Fixes #9533
---
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Collaborator
|
This ticket/PR has been released with Vaadin 25.2.0-rc1. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



BreadcrumbsItem.setTextused the defaultHasText#setText, which replaces all of the item's content — so calling it aftersetPrefixComponentremoved the prefix (e.g. an icon).The text is now held in a dedicated text node managed through
SignalPropertySupport, the same approachButtonandBadgeuse.setText/bindTextonly update that text node, so the prefix (and any other slotted content) is preserved.Fixes #9533
🤖 Generated with Claude Code