Skip to content
This repository has been archived by the owner on May 4, 2022. It is now read-only.

Alert: setCssClass doesn't work after alert.present() #53

Open
ionitron-bot bot opened this issue Nov 1, 2018 · 1 comment · May be fixed by Jankyboy/ionic-v3#21 or Jankyboy/ionic-v3#26
Open

Alert: setCssClass doesn't work after alert.present() #53

ionitron-bot bot opened this issue Nov 1, 2018 · 1 comment · May be fixed by Jankyboy/ionic-v3#21 or Jankyboy/ionic-v3#26
Labels

Comments

@ionitron-bot
Copy link

ionitron-bot bot commented Nov 1, 2018

Short description of the problem:

When setCssClass on an alert element after alert.present() class is not added

What behavior are you expecting?

Specified class added to element

Code

This works:

let alert = this.alertCtrl.create({
    title: "Title",
    message: "Message",
    buttons: ["OK"]
});
alert.setCssClass("alert-wide");
alert.present();

This doesn't work:

let alert = this.alertCtrl.create({
    title: "Title",
    message: "Message",
    buttons: ["OK"]
});
alert.present();
alert.setCssClass("alert-wide");

This doesn't work too, but instead alert.setMessage works also after present:

let alert = this.alertCtrl.create({
    title: "Title",
    message: "Message",
    buttons: [{
        text: "OK",
        handler: () => {
            alert.dismiss();
        }
    }, {
        text: "Details",
        handler: () => {
            alert.setCssClass("alert-wide");
            alert.setMessage("NewMessage");
            return false;
        }
    }]
});
alert.present();

Which Ionic Version?
2.x

Run ionic info from terminal/cmd prompt: (paste output below)

Cordova CLI: 6.3.1
Ionic Framework Version: 2.0.0-rc.0
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.1.0-beta.1
OS: Windows 8.1
Node Version: v6.7.0

@Ouael-Ben
Copy link

Still this bug no solution right now

@snyk-bot snyk-bot linked a pull request Mar 25, 2021 that will close this issue
@snyk-bot snyk-bot linked a pull request May 31, 2021 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
1 participant