-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Closed
Labels
package: core@ionic/core package@ionic/core packagetype: buga confirmed bug reporta confirmed bug report
Milestone
Description
Bug Report
Ionic version:
[ ] 4.x
[x] 5.x
Current behavior:
If you show/hide an <ion-loading> element too quickly you will orphan the DOM element and a new one will be created (the old one will never go away).
Expected behavior:
The component should gracefully handle showing/hiding via a bound prop.
Steps to reproduce:
Use ionic start to create an empty starter project, select Vue, then replace Home.vue with:
<template>
<ion-page>
<ion-content>
<ion-loading :is-open="loadingMessage" :message="loadingMessage"></ion-loading>
<ion-button @click="startLoading">Start Loading</ion-button>
</ion-content>
</ion-page>
</template>
<script lang="ts">
import { IonContent, IonPage, IonButton, IonLoading } from '@ionic/vue';
import { defineComponent } from 'vue';
export default defineComponent({
name: 'Home',
components: { IonContent, IonPage, IonButton, IonLoading },
data() {
return {
loadingMessage: '',
};
},
methods: {
startLoading() {
this.loadingMessage = 'A really long loading message so you can see it in the background...';
setTimeout(() => {
this.loadingMessage = '';
setTimeout(() => {
this.loadingMessage = 'Loading again...';
});
});
},
},
});
</script>
Ionic info:
Ionic:
Ionic CLI : 6.12.3 (/Users/troygilbert/.nvm/versions/node/v14.15.2/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/vue 5.5.4
Capacitor:
Capacitor CLI : 2.4.6
@capacitor/core : 2.4.6
Utility:
cordova-res (update available: 0.15.3) : 0.15.2
native-run : 1.3.0
System:
NodeJS : v14.15.2 (/Users/troygilbert/.nvm/versions/node/v14.15.2/bin/node)
npm : 6.14.10
OS : macOS Big Sur
Metadata
Metadata
Assignees
Labels
package: core@ionic/core package@ionic/core packagetype: buga confirmed bug reporta confirmed bug report