Ionic 5 - 'enableBackdropDismiss' does not exist in type 'LoadingOptions'

Hello,

I tried to set the enableBackdropDismiss to true for the loadingController as in the doc.

However, i’ve got an error during compilation :

    ERROR in src/app/services/alertAndToast/alert-and-toast.service.ts(202,7): error TS2345: Argument of type '{ spinner: "crescent"; duration: number; message: string; translucent: true; cssClass: string; showBackdrop: true; enableBackdropDismiss: boolean; }' is not assignable to parameter of type 'LoadingOptions'.
      Object literal may only specify known properties, and 'enableBackdropDismiss' does not exist in type 'LoadingOptions'.

Here is the code :

  async presentLoadingWithOptions(delay = 0, text = 'Please wait...') {
    const loading = await this.loadingController.create({
      spinner: 'crescent',
      duration: 40000,
      message: text,
      translucent: true,
      cssClass: 'custom-class custom-loading',
      showBackdrop : true,
      enableBackdropDismiss : true,
    });
    setTimeout(()=>{
      loading.present();}, delay) ;

    return loading;
  }

How can i enable the backdrop dismiss ?

You can see in the ion-loading properties that the correct is backdropDismiss and not enableBackdropDismiss. The documentation you linked is for ionic version 3.

1 Like

Thank you so much for your help !