()
| 4 | import { componentOnReady } from './helpers'; |
| 5 | |
| 6 | export const startStatusTap = () => { |
| 7 | const win = window; |
| 8 | win.addEventListener('statusTap', () => { |
| 9 | readTask(() => { |
| 10 | const width = win.innerWidth; |
| 11 | const height = win.innerHeight; |
| 12 | const el = document.elementFromPoint(width / 2, height / 2) as Element | null; |
| 13 | if (!el) { |
| 14 | return; |
| 15 | } |
| 16 | const contentEl = findClosestIonContent(el); |
| 17 | if (contentEl) { |
| 18 | new Promise((resolve) => componentOnReady(contentEl, resolve)).then(() => { |
| 19 | writeTask(async () => { |
| 20 | /** |
| 21 | * If scrolling and user taps status bar, |
| 22 | * only calling scrollToTop is not enough |
| 23 | * as engines like WebKit will jump the |
| 24 | * scroll position back down and complete |
| 25 | * any in-progress momentum scrolling. |
| 26 | */ |
| 27 | contentEl.style.setProperty('--overflow', 'hidden'); |
| 28 | |
| 29 | await scrollToTop(contentEl, 300); |
| 30 | |
| 31 | contentEl.style.removeProperty('--overflow'); |
| 32 | }); |
| 33 | }); |
| 34 | } |
| 35 | }); |
| 36 | }); |
| 37 | }; |
nothing calls this directly
no test coverage detected