fix(overlay): overlays are hidden until presented

fixes #15345
This commit is contained in:
Manu Mtz.-Almeida
2018-08-29 01:51:43 +02:00
parent 82f9fd4ce7
commit ba428cd765

View File

@ -9,7 +9,7 @@ export function createOverlay<T extends HTMLIonOverlayElement>(element: T, opts:
// convert the passed in overlay options into props
// that get passed down into the new overlay
Object.assign(element, opts);
element.classList.add('ion-page-hidden');
element.overlayId = lastId++;
// append the overlay element to the document body
@ -132,6 +132,9 @@ async function overlayAnimation(
overlay.animation = undefined;
}
// Make overlay visible in case it's hidden
baseEl.classList.remove('ion-page-hidden');
const aniRoot = baseEl.shadowRoot || overlay.el;
const animation = overlay.animation = await overlay.animationCtrl.create(animationBuilder, aniRoot, opts);
overlay.animation = animation;