Hi Guys, may I know if there is a way to render a long text on ion-alert with radio buttons as selection.
Here is my code,
async optionMessage(item){
console.log(item);
const alert = await this.alertController.create({
header: 'Treatment Record',
message: 'Do you want to?',
backdropDismiss: false,
inputs: [
{
name: 'show_treatment_notes',
type: 'radio',
label: 'Show the treatment notes',
value: 'show_treatment_notes',
},
{
name: 'edit_treatment_notes',
type: 'radio',
label: 'Edit the treatment notes',
value: 'edit_treatment_notes',
}
],
buttons: [
{
text: 'Cancel',
role: 'cancel',
cssClass: 'secondary',
handler: ()=> {
console.log('cancel')
}
},
{
text: 'Ok',
handler:(data : string) => {
if(data == 'show_treatment_notes'){
}else{
}
}
}
]
});
await alert.present();
}
Here is the sample output,
What I wanted to do is to remove the ellipsis and show the entire text instead.
I have tried this solutions but no one work for me. Anyway, I think I misapplied this solution should anyone could correct me? or is there another way to solve this?
Note: These solutions are not working and all place in app.scss
Solution #1
.alert-radio-label.sc-ion-alert-md,
.alert-radio-label.sc-ion-alert-ios {
white-space: normal;
}
Solution #2
ion-alert.select-alert.single-select-alert .alert-radio-label {
white-space: pre-wrap;
}
Solution #3
.alert-radio-label.sc-ion-alert-md {
padding-left: 52px;
padding-right: 26px;
padding-top: 13px;
padding-bottom: 13px;
flex: 1;
color: var(--ion-color-step-850, #262626);
font-size: 14px;
text-overflow: ellipsis;
white-space: pre-line;
}
Thanks. More power to ionic.