diff --git a/core/src/utils/status-tap.ts b/core/src/utils/status-tap.ts index 6d7af60f23..4e3c55c87e 100644 --- a/core/src/utils/status-tap.ts +++ b/core/src/utils/status-tap.ts @@ -1,19 +1,22 @@ import { QueueApi } from '@stencil/core'; export function startStatusTap(win: Window, queue: QueueApi) { - queue.read(async () => { - const width = win.innerWidth; - const height = win.innerWidth; - const el = win.document.elementFromPoint(width / 2, height / 2); - if (!el) { - return; - } - const contentEl = el.closest('ion-content'); - if (contentEl) { - await contentEl.componentOnReady(); - queue.write(() => { - contentEl.scrollToTop(300); - }); - } + win.addEventListener('statusTap', () => { + queue.read(() => { + const width = win.innerWidth; + const height = win.innerHeight; + const el = win.document.elementFromPoint(width / 2, height / 2); + if (!el) { + return; + } + const contentEl = el.closest('ion-content'); + if (contentEl) { + contentEl.componentOnReady().then(() => { + queue.write(() => { + contentEl.scrollToTop(300); + }); + }); + } + }); }); }