Skip to content

Commit 330a64a

Browse files
committed
fix(progress-bar): query state animation not working
Currently the animation for a progress bar in the `query` state is disabled by default due to the `_noop-animation` producing the wrong selector. It looks like using the ampersand inside interpolation (e.g. in `@at-root ._mat-animation-noopable#{&}`) doesn't work as expected once we have more than one selector. What ends up happening is that SASS interpolates the first selector, but then leaves the other one as it is, which causes it to disable the animation. Fixes #11453.
1 parent 55aaa03 commit 330a64a

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

src/lib/progress-bar/progress-bar.scss

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ $mat-progress-bar-piece-animation-duration: 250ms !default;
3535
// The progress bar buffer is the bar indicator showing the buffer value and is only visible
3636
// beyond the current value of the primary progress bar.
3737
.mat-progress-bar-buffer {
38-
@include _noop-animation();
3938
transform-origin: top left;
4039
transition: transform $mat-progress-bar-piece-animation-duration ease;
4140
}
@@ -48,15 +47,13 @@ $mat-progress-bar-piece-animation-duration: 250ms !default;
4847

4948
// The progress bar fill fills the progress bar with the indicator color.
5049
.mat-progress-bar-fill {
51-
@include _noop-animation();
5250
animation: none;
5351
transform-origin: top left;
5452
transition: transform $mat-progress-bar-piece-animation-duration ease;
5553
}
5654

5755
// A pseudo element is created for each progress bar bar that fills with the indicator color.
5856
.mat-progress-bar-fill::after {
59-
@include _noop-animation();
6057
animation: none;
6158
content: '';
6259
display: inline-block;
@@ -81,27 +78,23 @@ $mat-progress-bar-piece-animation-duration: 250ms !default;
8178
&[mode='indeterminate'],
8279
&[mode='query'] {
8380
.mat-progress-bar-fill {
84-
@include _noop-animation();
8581
transition: none;
8682
}
8783
.mat-progress-bar-primary {
8884
// Avoids stacked animation tearing in Firefox >= 57.
89-
@include _noop-animation();
9085
@include backface-visibility(hidden);
9186
animation: mat-progress-bar-primary-indeterminate-translate
9287
$mat-progress-bar-full-animation-duration infinite linear;
9388
left: -145.166611%;
9489
}
9590
.mat-progress-bar-primary.mat-progress-bar-fill::after {
9691
// Avoids stacked animation tearing in Firefox >= 57.
97-
@include _noop-animation();
9892
@include backface-visibility(hidden);
9993
animation: mat-progress-bar-primary-indeterminate-scale
10094
$mat-progress-bar-full-animation-duration infinite linear;
10195
}
10296
.mat-progress-bar-secondary {
10397
// Avoids stacked animation tearing in Firefox >= 57.
104-
@include _noop-animation();
10598
@include backface-visibility(hidden);
10699
animation: mat-progress-bar-secondary-indeterminate-translate
107100
$mat-progress-bar-full-animation-duration infinite linear;
@@ -110,7 +103,6 @@ $mat-progress-bar-piece-animation-duration: 250ms !default;
110103
}
111104
.mat-progress-bar-secondary.mat-progress-bar-fill::after {
112105
// Avoids stacked animation tearing in Firefox >= 57.
113-
@include _noop-animation();
114106
@include backface-visibility(hidden);
115107
animation: mat-progress-bar-secondary-indeterminate-scale
116108
$mat-progress-bar-full-animation-duration infinite linear;
@@ -120,12 +112,26 @@ $mat-progress-bar-piece-animation-duration: 250ms !default;
120112
&[mode='buffer'] {
121113
.mat-progress-bar-background {
122114
// Avoids stacked animation tearing in Firefox >= 57.
123-
@include _noop-animation();
124115
@include backface-visibility(hidden);
125116
animation: mat-progress-bar-background-scroll
126117
$mat-progress-bar-piece-animation-duration infinite linear;
127118
}
128119
}
120+
121+
// Disabled animations handling.
122+
&._mat-animation-noopable {
123+
.mat-progress-bar-fill,
124+
.mat-progress-bar-fill::after,
125+
.mat-progress-bar-buffer,
126+
.mat-progress-bar-primary,
127+
.mat-progress-bar-primary.mat-progress-bar-fill::after,
128+
.mat-progress-bar-secondary,
129+
.mat-progress-bar-secondary.mat-progress-bar-fill::after,
130+
.mat-progress-bar-background {
131+
animation: none;
132+
transition: none;
133+
}
134+
}
129135
}
130136

131137

0 commit comments

Comments
 (0)