Skip to content

Commit 3a05b79

Browse files
authored
fix: only animate grid tree toggle within a focused row (#10336)
1 parent b315015 commit 3a05b79

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

packages/grid/src/styles/vaadin-grid-base-styles.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@ export const gridStyles = css`
138138
position: relative;
139139
}
140140
141+
[part~='row']:not(:focus-within) {
142+
--_non-focused-row-none: none;
143+
}
144+
141145
[part~='row'][loading] [part~='body-cell'] ::slotted(vaadin-grid-cell-content) {
142146
visibility: hidden;
143147
}

packages/grid/src/styles/vaadin-grid-tree-toggle-base-styles.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export const gridTreeToggleStyles = css`
5454
5555
@media (prefers-reduced-motion: no-preference) {
5656
[part='toggle']::before {
57-
transition: rotate 120ms;
57+
transition: var(--_non-focused-row-none, rotate 120ms);
5858
}
5959
}
6060

packages/grid/src/vaadin-grid-tree-column-mixin.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ export const GridTreeColumnMixin = (superClass) =>
4949
toggle.__rendererExpanded = expanded;
5050
toggle.expanded = expanded;
5151
toggle.leaf = !hasChildren;
52-
toggle.textContent = this.__getToggleContent(this.path, item);
52+
const content = this.__getToggleContent(this.path, item);
53+
if (toggle.textContent !== content) {
54+
// Only update textContent if it has changed to avoid toggle animation issues on Safari
55+
toggle.textContent = content;
56+
}
5357
toggle.level = level;
5458
}
5559

0 commit comments

Comments
 (0)