How to disable Ion Alert Buttons,
where can we add disabled=“true”.
Thank you.
Add two styles
.alert-button-cancel {
background-color: blue;
border-color: blue;
color:white;
max-height: 25px;
}
.alert-button-cancel-disabled{
pointer-events: none;
border: 1px solid #999999 !important;
background-color: #cccccc !important;
color: #666666 !important;
max-height: 25px;
}
Set the cssClass based on some condition
buttons: [
{
text: 'No',
cssClass:this.cancelBtnDisabled ? 'alert-button-cancel-disabled' : 'alert-button-cancel',
},
{
text: 'Yes',
cssClass:'alert-button-confirm'
},
],
How to apply alert button styles
///Ionic 6 Alert controller : How to style checkbox, checkmark, buttons in Alert - YouTube
I also tried like this only…
but some part of button is not working as disable button.
I mean when I click on disable button to the corner areas. it wont work as disabled button… remaining part of button is works fine… I don’t know why?
Checked by adding handler for the disable button. but handler not executed even on clicking button corner.
uploaded demo at
///GitHub - sarvosmi/ionicAlertCheckboxStyles