Skip to content

Commit

Permalink
fix: internal state of uploading component when stopped
Browse files Browse the repository at this point in the history
  • Loading branch information
lee-chase committed Apr 12, 2022
1 parent c32a189 commit b5fa8e4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/core/src/components/cv-loading/cv-loading.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
:class="{
'cv-loading': !overlay,
[`${carbonPrefix}--loading`]: active || stopping,
[`${carbonPrefix}--loading--stop`]: !active && stopping,
[`${carbonPrefix}--loading--stop`]: (!active && stopping) || stopped,
[`${carbonPrefix}--loading--small`]: small,
}"
ref="loading"
Expand Down Expand Up @@ -55,6 +55,7 @@ export default {
},
data() {
return {
stopped: false,
stopping: false,
};
},
Expand All @@ -69,10 +70,12 @@ export default {
this.$refs.loading.removeEventListener('animationend', this.onEnd);
this.stopping = false;
this.stopped = true;
this.$emit('loading-end');
}
},
onActiveUpdate(newValue) {
this.stopped = false;
this.stopping = !newValue;
if (!newValue) {
this.$refs.loading.addEventListener('animationend', this.onEnd);
Expand Down

0 comments on commit b5fa8e4

Please sign in to comment.