Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70443

IONIC 4 Toast button color not changing for anything (bug?)

$
0
0

@SanduCuragau wrote:

Man I’ve seen like 3 topics about this and none helped, one even declared it is an unsolvable bug at the moment, but come on there must be something that could be done about it right now to get it done

All I want is the SIM button in the toast to be white, which if you notice has no role, the button with role “cancel” actually has the color I wanted, a tricky thing I tried was adding role “cancel” to the functional SIM button too and trying to handle it, but nevermind since the handler code won’t execute if I set role cancel to the SIM button, is there any other role I can add to it instead? Appearently buttons with roles get the color we want, buttons without it get the primary default color and we can’t change it, so I was wondering if there’s anything I could do about it, add some role to the SIM button that still let’s me handle it, something in css, or if there’s any other trick I could try to get this thing done

image

TS:

  async recuperarPassword() {
    const toast = await this.toastCtrl.create({
      header: 'Login incorreto!',
      message: 'Deseja recuperar a conta?',
      position: 'bottom',
      duration: 0,
      cssClass: 'customToast',
      buttons: [
        {
          side: 'start',
          text: 'SIM',
          handler: () => {
            // functional code that I want to execute here
          }
        }, {
          text: 'NÃO',
          role: 'cancel',
          handler: () => {
            // the toast just closes
          }
        }
      ]
    });
    toast.present();
  }

GLOBAL.SCSS

.customToast {
    text-align: center !important;
    --button-color: #ffffff;
    --max-height: 70px;
    --background: #f04141e8;
    --border-style:solid;
    --border-width :1px;
    --border-color:#d33939;
    // SHOULD be button color 
    --color:#ffffff !important; 
    color:#ffffff !important;
}

I’ve seen these but didn’t help

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70443

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>