Skip to content

Commit 689f945

Browse files
Merge pull request #5311 from christophe-g:cg-remove-unecessary-progress-animation
PiperOrigin-RevId: 594013260
2 parents c9360e2 + f0dab48 commit 689f945

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

progress/internal/_linear-progress.scss

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,12 @@ $_indeterminate-duration: 2s;
114114
z-index: -1; // Place behind tracks for Safari
115115
}
116116

117+
// dots are hidden when indeterminate or when there is no visible buffer to
118+
// prevent infinite invisible animation.
119+
.dots[hidden] {
120+
display: none;
121+
}
122+
117123
// indeterminate
118124
.indeterminate .bar {
119125
transition: none;
@@ -131,10 +137,6 @@ $_indeterminate-duration: 2s;
131137
display: block;
132138
}
133139

134-
.indeterminate .dots {
135-
display: none;
136-
}
137-
138140
.indeterminate .primary-bar {
139141
animation: linear infinite $_indeterminate-duration;
140142
animation-name: primary-indeterminate-translate;

progress/internal/linear-progress.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,12 @@ export class LinearProgress extends Progress {
3434
}%)`,
3535
};
3636

37+
// Only display dots when visible - this prevents invisible infinite
38+
// animation.
39+
const hideDots =
40+
this.indeterminate || this.buffer >= this.max || this.value >= this.max;
3741
return html`
38-
<div class="dots"></div>
42+
<div class="dots" ?hidden=${hideDots}></div>
3943
<div class="inactive-track" style=${styleMap(dotStyles)}></div>
4044
<div class="bar primary-bar" style=${styleMap(progressStyles)}>
4145
<div class="bar-inner"></div>

0 commit comments

Comments
 (0)