1

I migrated from Ionic 4 to Ionic 5 and noticed my toastControllers are not showing the "close" button even if I set up the ToastOptions properties with showCloseButton: true

Leonardo Nomdedeu
  • 814
  • 1
  • 8
  • 11

1 Answers1

1

I fixed it adding explicitly the buttons array like this:

let toast = this.toastCtrl.create({
    message: 'User was added successfully',
    showCloseButton: true,
    position: 'top',
    buttons: [
          {
            text: "close",
            handler: () => {
              console.log('Close clicked');
            }
          }
        ]
  });
Leonardo Nomdedeu
  • 814
  • 1
  • 8
  • 11