Skip to content

bug: IonToast with IonicSafeString display 'undefined' #27118

@ghost

Description

Prerequisites

Ionic Framework Version

v7.x

Current Behavior

When I try to display an IonToast with a message containing an IonicSafeString, the text "undefined" is displayed inside the ion-toast, instead of the contents of the IonicSafeString

Expected Behavior

The IonToast must display the contents of the IonicSafeString

Steps to Reproduce

  1. Create an IonToast with the use of ToastController
  2. In message property set a IonicSafeString with 'Hello!'
  3. Present the IonToast and see the message 'undefined' in it

Code Reproduction URL

https://stackblitz.com/edit/angular-sxv7cl?file=src/app/example.component.ts

Ionic Info

Ionic:

Ionic CLI : 7.0.0
Ionic Framework : not installed
@angular-devkit/build-angular : 15.2.4
@angular-devkit/schematics : 15.2.4
@angular/cli : 15.2.4
@ionic/angular-toolkit : 7.0.0

Capacitor:

Capacitor CLI : 4.6.2
@capacitor/android : not installed
@capacitor/core : 4.6.2
@capacitor/ios : not installed

Utility:

cordova-res : not installed globally
native-run : 1.7.2

System:

NodeJS : v16.20.0
npm : 8.19.4
OS : Windows 10

Additional Information

With previous versions of Ionic (for example 6) the issue does not occur

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions