feat(tree-view): add trailing content slot to tree view item - #2692
Open
TaylorShane wants to merge 1 commit into
Open
feat(tree-view): add trailing content slot to tree view item#2692TaylorShane wants to merge 1 commit into
TaylorShane wants to merge 1 commit into
Conversation
TaylorShane
force-pushed
the
feat/tree-view-trailing-content
branch
2 times, most recently
from
September 2, 2026 22:09
dea0af9 to
827cb74
Compare
Add a `trailing` content projection slot to `si-tree-view-item`, rendered after the label and icons and outside the drag grab-area. This lets consumers place custom content (buttons, inputs, third-party components) at the trailing edge of a tree item without interfering with drag-and-drop. To keep trailing content drag-safe, the item's main content area (`grab-area`) is now registered as the drag handle, so a drag can only be initiated from the label/icon region. NOTE: For draggable tree items, dragging now starts only from the item's main content area, not from the trailing slot or the end-icons region.
TaylorShane
force-pushed
the
feat/tree-view-trailing-content
branch
from
September 3, 2026 13:32
827cb74 to
25854aa
Compare
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.
What this adds
A
trailingcontent slot forsi-tree-view-item. It lets you place your own content — a button, an input, a badge, a third‑party component — at the end of a tree row, after the label and icons, without it becoming part of the drag area.The problem (current behavior)
Today
si-tree-view-itemhas only one projection slot, and it lives inside the draggable region (.grab-area). That causes two issues when a row needs custom content and drag‑and‑drop:si-tree-view-item— the tree's drop indicator (the blue insertion line) doesn't render and the row leaves a full‑height gap while dragging (see Before).The fix (what changed)
Two small, coordinated changes in
si-tree-view-item:trailingslot, rendered after the label/icons and outside.grab-area(the default slot now excludes[slot=trailing])..grab-areais now the drag handle. A drag can only start from the item's main content region, so anything in thetrailingslot is inherently drag‑safe.Together these let you put
cdkDragdirectly on thesi-tree-view-item(so the tree's normal drop indicator works) while still having a spot for custom content that won't hijack the drag.Behavior change
Why it's useful
Rows that combine an action/indicator with drag‑and‑drop are a common pattern (acknowledge/select toggles, counters, quantity inputs, status chips). Previously each consumer had to work around the single in‑handle slot with custom wrappers and CSS. This gives everyone a supported, drag‑safe extension point on the component itself.
Testing
.grab-area, and it is not inside the drag handle (so it can't start a drag); existing drag/placeholder tests still pass.si-tree-view-trailing-content) demonstrating an interactive button in the slot alongside reorder drag‑and‑drop.Before / After
Before:
After:
Checklist
feat(tree-view): …) with the behavior change notedLive Preview
This probably isn't necessary and the existing
si-tree-view-drag-drop-copycould incorporate this.