mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-23 05:58:26 +08:00
fix(modal): fixes displaying page inside modal
This commit is contained in:
@ -97,28 +97,3 @@ ion-modal-controller {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.modal-content {
|
|
||||||
@include position(0, null, null, 0);
|
|
||||||
|
|
||||||
position: absolute;
|
|
||||||
|
|
||||||
display: block;
|
|
||||||
|
|
||||||
// override the default visibility cloaking
|
|
||||||
// added for each component before it's loaded
|
|
||||||
// visibility: inherit !important;
|
|
||||||
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
|
|
||||||
// do not show by default, but still render
|
|
||||||
// so we can get dimensions before transitioning in
|
|
||||||
opacity: 0;
|
|
||||||
|
|
||||||
contain: strict;
|
|
||||||
}
|
|
||||||
|
|
||||||
.show-modal .modal-content {
|
|
||||||
// show the modal now that it's ready
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
@ -163,13 +163,12 @@ export class Modal {
|
|||||||
protected render() {
|
protected render() {
|
||||||
const ThisComponent = this.component;
|
const ThisComponent = this.component;
|
||||||
|
|
||||||
let userCssClasses = 'modal-content';
|
let userCssClasses = 'ion-page';
|
||||||
if (this.cssClass) {
|
if (this.cssClass) {
|
||||||
userCssClasses += ` ${this.cssClass}`;
|
userCssClasses += ` ${this.cssClass}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
const dialogClasses = createThemedClasses(this.mode, this.color, 'modal-wrapper');
|
const dialogClasses = createThemedClasses(this.mode, this.color, 'modal-wrapper');
|
||||||
const thisComponentClasses = createThemedClasses(this.mode, this.color, userCssClasses);
|
|
||||||
|
|
||||||
return [
|
return [
|
||||||
<div
|
<div
|
||||||
@ -185,7 +184,7 @@ export class Modal {
|
|||||||
>
|
>
|
||||||
<ThisComponent
|
<ThisComponent
|
||||||
{...this.componentProps}
|
{...this.componentProps}
|
||||||
class={thisComponentClasses}
|
class={userCssClasses}
|
||||||
>
|
>
|
||||||
</ThisComponent>
|
</ThisComponent>
|
||||||
</div>
|
</div>
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
function presentModal() {
|
function presentModal() {
|
||||||
controller
|
controller
|
||||||
.create({
|
.create({
|
||||||
component: 'ion-content'
|
component: 'page-one'
|
||||||
})
|
})
|
||||||
.then(modal => {
|
.then(modal => {
|
||||||
modal.present();
|
modal.present();
|
||||||
|
Reference in New Issue
Block a user