Back to articles
Listening to Scroll in ArkUI Web: Global Scroll & Bottom Detection with onScroll - onOverScroll
NewsDevOps

Listening to Scroll in ArkUI Web: Global Scroll & Bottom Detection with onScroll - onOverScroll

via Dev.toHarmonyOS

Read the original article:Listening to Scroll in ArkUI Web: Global Scroll & Bottom Detection with onScroll - onOverScroll Listening to Scroll in ArkUI Web: Global Scroll & Bottom Detection with onScroll - onOverScroll Requirement Description Provide a way to detect the scroll direction and position for a page rendered inside the ArkUI Web component: Detect up/down scrolling. Detect when the page has reached the top or bottom . Background Knowledge Web.onScroll — notifies the global page scroll position. It won’t fire for local (element-level) scrolls inside the page. Tip: To confirm global scrolling, compare window.pageYOffset / window.pageXOffset before vs. after scroll. Scroll.onWillScroll — ArkUI Scroll ’s pre-scroll callback (for ArkUI scroll containers, not Web ). Docs: https://developer.huawei.com/consumer/en/doc/harmonyos-references/ts-container-scroll#onwillscroll12 Web.onOverScroll — detects overscroll at top/bottom (or left/right ), useful to infer “reached end.” Implementati

Continue reading on Dev.to

Opens in a new tab

Read Full Article
2 views

Related Articles