si-tree-view: the label jumps aside while the loading spinner fades out beside the returning chevron
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- angular, scss, typescript
Research direction
Read projects/element-ng/tree-view/si-tree-view-item/si-tree-view-item.component.html and its SCSS, then inspect the spinner leave animation in projects/element-ng/loading-spinner/si-loading-spinner.component.ts. Reproduce the delayed child load in src/app/examples/si-tree-view/si-tree-view-playground.ts and check the toggle layout as the spinner fades. Done means the chevron replaces the spinner without the toggle widening or the label shifting.
Written by the indexing model from the issue text.
Description
Prerequisites
- I have read the Contributing Guidelines.
- I have not leaked any internal/restricted information like screenshots, videos, code snippets, links etc.
Affected component
si-tree-view (SiTreeViewItemComponent, the folder state toggle)
Summary
While a lazily loaded node's children load, the toggle shows si-loading-spinner instead of the chevron. When the
children arrive, the chevron comes back at once, but the spinner stays in the toggle for its 0.2 s leave fade next to
it. For that moment the toggle holds two icons, so it widens and the item's label jumps to the side and back on every
open of a lazy node.
Version
@siemens/element-ng51.6.0,@siemens/element-theme51.6.0 (also onmain, 46b5bac,
projects/element-ng/tree-view/si-tree-view-item/si-tree-view-item.component.htmland
projects/element-ng/loading-spinner/si-loading-spinner.component.ts)- Angular 22, Chromium and Firefox
Steps to reproduce
- A
si-tree-viewwith an item that has children but none loaded yet (state: 'collapsed',children: []), and a
(loadChildren)handler that answers after a short delay:
setTimeout(() => event.callback(event.treeItem, children), 500); - Open the item with its toggle and watch its label when the children arrive.
Code reproduction example
No hosted example. The playground (src/app/examples/si-tree-view/si-tree-view-playground.ts) shows it with a lazy
item when its children arrive after a delay.
What is the current bug behavior
The toggle template switches between the spinner and the chevron:
@if (isExpanding) {
<si-loading-spinner />
} @else {
<i aria-hidden="true" [class]="`${toggleIcon} ${folderStateClass}`"></i>
}
si-loading-spinner has host: { 'animate.leave': 'spinner-leave' } (opacity to 0 over 0.2 s). When state leaves
'expanding', the chevron is rendered right away and the spinner element is kept until its leave transition ends, so
both are laid out side by side in the toggle's flex box. The toggle grows by one icon width for 0.2 s and the label
moves aside, then back.
What is the expected correct behavior
The label stays in place. The chevron takes the spinner's place, and the spinner may fade out over it.
Possible fix
While the spinner is still there, take the chevron after it out of the flow. An absolutely positioned child of the
toggle's flex box keeps its static position at the box's center, and the leaving spinner, as large as the chevron,
keeps the toggle's width. The rule must not wait for spinner-leave, which Angular adds only after the render that
brought the chevron back:
--- a/projects/element-ng/tree-view/si-tree-view-item/si-tree-view-item.component.scss
+++ b/projects/element-ng/tree-view/si-tree-view-item/si-tree-view-item.component.scss
a.si-tree-view-item-toggle,
.si-tree-context-menu-btn > div[role='button'] {
cursor: pointer;
}
+
+// The spinner fades out (`spinner-leave`) after the chevron is back; keep the toggle one icon wide meanwhile.
+.si-tree-view-item-toggle > si-loading-spinner + i {
+ position: absolute;
+}
We use the same rule from a global stylesheet as a workaround, and the label no longer moves.
- Dominant language
- TypeScript
- Stars
- 85
- Forks
- 28
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 162
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from siemens/element
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
modal sizes: add missing modal sizes in UX documentationPossibly taken @panch1739 claimed this 8 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
siemens/element#3101 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
The copy button in the documentation is brokenPossibly taken @kfenner claimed this 18 days ago. Openbug documentation
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
siemens/element#2997 · 1 comment ·
Maintainers usually reply within 1 day
-
filtered-search: search button does nothing if doSearchOnInputChange is setPossibly taken @spike-rabbit claimed this 29 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
siemens/element#2917 · 4 comments · 1 assignee ·
Maintainers usually reply within 1 day
Similar issues
-
account bug communication lecture
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
area:tui bug platform:macos
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
anthropics/claude-code#109005 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 87/100
openedx/end-to-end-tests#196 ·
Maintainers usually reply within 1 day
-
area:tooling good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
interledger/publisher-tools#1007 ·
Maintainers usually reply within 1 day
-
priority/medium roadmap/v1.1.1 stakeholder/rapr type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
databrickslabs/ontos#1420 ·
Maintainers usually reply within 3 days