Skip to content

Commit 0e62ae7

Browse files
supachailllpaymarcosmoura
authored andcommitted
fix(MdProgressSpinner): improve transition (#1946)
* Fix MdProgressSpinner transition * Use CSS transition duration instead of explicit variable * Add missing watcher for mdValue and mdStroke
1 parent 76274e8 commit 0e62ae7

File tree

1 file changed

+23
-6
lines changed

1 file changed

+23
-6
lines changed

src/components/MdProgress/MdProgressSpinner/MdProgressSpinner.vue

+23-6
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,15 @@
9696
}
9797
},
9898
watch: {
99+
mdValue () {
100+
this.attachCircleStyle()
101+
},
99102
mdDiameter () {
100103
this.attachSvgStyle()
101104
this.attachCircleStyle()
105+
},
106+
mdStroke () {
107+
this.attachCircleStyle()
102108
}
103109
},
104110
methods: {
@@ -169,7 +175,7 @@
169175
transform: rotate(4680deg)
170176
}
171177
}
172-
178+
173179
@keyframes md-progress-spinner-stroke-rotate {
174180
0% {
175181
stroke-dashoffset: var(--md-progress-spinner-start-value);
@@ -260,31 +266,42 @@
260266
animation: md-progress-spinner-rotate 2s linear infinite;
261267
262268
&.md-progress-spinner-enter,
263-
&.md-progress-spinner-leave-active {
264-
transition-duration: .4s;
265-
269+
&.md-progress-spinner-leave-to {
266270
.md-progress-spinner-draw {
267271
opacity: 0;
268272
transform: scale(.1);
269273
}
270274
}
271275
276+
&.md-progress-spinner-enter-active,
277+
&.md-progress-spinner-leave-active {
278+
transition-duration: .4s;
279+
animation: none;
280+
}
281+
272282
.md-progress-spinner-circle {
273283
animation: 4s infinite $md-transition-stand-timing;
274284
animation-name: md-progress-spinner-stroke-rotate;
275285
}
276286
}
277287
278288
&.md-determinate {
279-
&.md-progress-spinner-enter-active,
280-
&.md-progress-spinner-leave-active {
289+
&.md-progress-spinner-enter-active {
281290
transition-duration: 2s;
282291
283292
.md-progress-spinner-draw {
284293
animation: md-progress-spinner-initial-rotate 1.98s $md-transition-stand-timing forwards;
285294
}
286295
}
287296
297+
&.md-progress-spinner-leave-active {
298+
transition-duration: 2s;
299+
300+
.md-progress-spinner-draw {
301+
animation: md-progress-spinner-initial-rotate reverse 1.98s $md-transition-stand-timing forwards;
302+
}
303+
}
304+
288305
.md-progress-spinner-draw {
289306
transition: none;
290307
}

0 commit comments

Comments
 (0)