fix(tabs): fix goto root (#16926)

fixes #16917
This commit is contained in:
Manu MA
2019-01-01 17:51:38 +01:00
committed by GitHub
parent cda2573fdd
commit 8ee9205629
3 changed files with 32 additions and 36 deletions

View File

@ -139,31 +139,29 @@ async function overlayAnimation(
overlay.animation.destroy();
overlay.animation = undefined;
return false;
} else {
// Make overlay visible in case it's hidden
baseEl.classList.remove('overlay-hidden');
const aniRoot = baseEl.shadowRoot || overlay.el;
const animation = overlay.animation = await import('./animation').then(mod => mod.create(animationBuilder, aniRoot, opts));
overlay.animation = animation;
if (!overlay.animated || !overlay.config.getBoolean('animated', true)) {
animation.duration(0);
}
if (overlay.keyboardClose) {
animation.beforeAddWrite(() => {
const activeElement = baseEl.ownerDocument!.activeElement as HTMLElement;
if (activeElement && activeElement.matches('input, ion-input, ion-textarea')) {
activeElement.blur();
}
});
}
await animation.playAsync();
const hasCompleted = animation.hasCompleted;
animation.destroy();
overlay.animation = undefined;
return hasCompleted;
}
// Make overlay visible in case it's hidden
baseEl.classList.remove('overlay-hidden');
const aniRoot = baseEl.shadowRoot || overlay.el;
const animation = overlay.animation = await import('./animation').then(mod => mod.create(animationBuilder, aniRoot, opts));
overlay.animation = animation;
if (!overlay.animated || !overlay.config.getBoolean('animated', true)) {
animation.duration(0);
}
if (overlay.keyboardClose) {
animation.beforeAddWrite(() => {
const activeElement = baseEl.ownerDocument!.activeElement as HTMLElement;
if (activeElement && activeElement.matches('input, ion-input, ion-textarea')) {
activeElement.blur();
}
});
}
await animation.playAsync();
const hasCompleted = animation.hasCompleted;
animation.destroy();
overlay.animation = undefined;
return hasCompleted;
}
export function autoFocus(containerEl: HTMLElement): HTMLElement | undefined {