mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-22 05:21:52 +08:00
fix(alert): add padding under the alert title for iOS when there is no message
closes #5299
This commit is contained in:
@ -94,6 +94,12 @@ ion-alert {
|
|||||||
text-align: $alert-ios-message-text-align;
|
text-align: $alert-ios-message-text-align;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.alert-message {
|
||||||
|
&:empty {
|
||||||
|
padding: 0 0 12px 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// iOS Alert Input
|
// iOS Alert Input
|
||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
|
@ -69,6 +69,10 @@ $alert-md-buttons-justify-content: flex-end !default;
|
|||||||
|
|
||||||
.alert-message {
|
.alert-message {
|
||||||
font-size: $alert-md-message-font-size;
|
font-size: $alert-md-message-font-size;
|
||||||
|
|
||||||
|
&:empty {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -52,10 +52,6 @@ ion-alert {
|
|||||||
|
|
||||||
.alert-message {
|
.alert-message {
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
|
||||||
&:empty {
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.alert-input {
|
.alert-input {
|
||||||
|
@ -248,7 +248,7 @@ export class Alert extends ViewController {
|
|||||||
'<h2 id="{{hdrId}}" class="alert-title" *ngIf="d.title" [innerHTML]="d.title"></h2>' +
|
'<h2 id="{{hdrId}}" class="alert-title" *ngIf="d.title" [innerHTML]="d.title"></h2>' +
|
||||||
'<h3 id="{{subHdrId}}" class="alert-sub-title" *ngIf="d.subTitle" [innerHTML]="d.subTitle"></h3>' +
|
'<h3 id="{{subHdrId}}" class="alert-sub-title" *ngIf="d.subTitle" [innerHTML]="d.subTitle"></h3>' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'<div id="{{msgId}}" class="alert-message" *ngIf="d.message" [innerHTML]="d.message"></div>' +
|
'<div id="{{msgId}}" class="alert-message" [innerHTML]="d.message"></div>' +
|
||||||
'<div *ngIf="d.inputs.length" [ngSwitch]="inputType">' +
|
'<div *ngIf="d.inputs.length" [ngSwitch]="inputType">' +
|
||||||
|
|
||||||
'<template ngSwitchWhen="radio">' +
|
'<template ngSwitchWhen="radio">' +
|
||||||
@ -335,6 +335,10 @@ class AlertCmp {
|
|||||||
} else if (this.d.subTitle) {
|
} else if (this.d.subTitle) {
|
||||||
this.descId = this.subHdrId;
|
this.descId = this.subHdrId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!this.d.message) {
|
||||||
|
this.d.message = '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onPageLoaded() {
|
onPageLoaded() {
|
||||||
|
@ -59,7 +59,7 @@ class E2EPage {
|
|||||||
this.nav.present(alert);
|
this.nav.present(alert);
|
||||||
}
|
}
|
||||||
|
|
||||||
doAlertNoBody() {
|
doAlertNoMessage() {
|
||||||
let alert = Alert.create({
|
let alert = Alert.create({
|
||||||
title: 'Alert',
|
title: 'Alert',
|
||||||
buttons: ['OK']
|
buttons: ['OK']
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<button block class="e2eOpenAlert" (click)="doAlert()">Alert</button>
|
<button block class="e2eOpenAlert" (click)="doAlert()">Alert</button>
|
||||||
<button block class="e2eOpenAlertLongMessage" (click)="doAlertLongMessage()">Alert Long Message</button>
|
<button block class="e2eOpenAlertLongMessage" (click)="doAlertLongMessage()">Alert Long Message</button>
|
||||||
<button block class="e2eOpenMultipleButtons" (click)="doMultipleButtons()">Multiple Buttons (>2)</button>
|
<button block class="e2eOpenMultipleButtons" (click)="doMultipleButtons()">Multiple Buttons (>2)</button>
|
||||||
<button block class="e2eOpenAlertNoBody" (click)="doAlertNoBody()">Alert No Body</button>
|
<button block class="e2eOpenAlertNoMessage" (click)="doAlertNoMessage()">Alert No Message</button>
|
||||||
<button block class="e2eOpenConfirm" (click)="doConfirm()">Confirm</button>
|
<button block class="e2eOpenConfirm" (click)="doConfirm()">Confirm</button>
|
||||||
<button block class="e2eOpenPrompt" (click)="doPrompt()">Prompt</button>
|
<button block class="e2eOpenPrompt" (click)="doPrompt()">Prompt</button>
|
||||||
<button block class="e2eOpenRadio" (click)="doRadio()">Radio</button>
|
<button block class="e2eOpenRadio" (click)="doRadio()">Radio</button>
|
||||||
|
Reference in New Issue
Block a user