Skip to content

Prevent pull-to-refresh from triggering while scrolling in a nested scrollable element on the page#310

Merged
jayohms merged 2 commits into
mainfrom
webview-element-scrolling
Feb 24, 2024
Merged

Prevent pull-to-refresh from triggering while scrolling in a nested scrollable element on the page#310
jayohms merged 2 commits into
mainfrom
webview-element-scrolling

Conversation

@jayohms

@jayohms jayohms commented Feb 24, 2024

Copy link
Copy Markdown
Collaborator

This fixes: #294

This prevents pull-to-refresh from being triggered when (potentially) nested scrolling within an element on the page that is using overflow-y: scroll or overflow-y: auto. To address this, the following item were added:

  • On every touch start, check if the target element or any of its parent elements are scrollable. If any are scrollable, notify the TurboWebView that the currently touched element is scrollable.
  • On every touch end, reset the internal state of the TurboWebView.
  • Whenever the TurboSwipeRefreshLayout checks to see if its scrollable child can scroll up, check the state of the TurboWebView if a scrollable element is currently being touched.

@jayohms jayohms merged commit 262fef1 into main Feb 24, 2024
@jayohms jayohms deleted the webview-element-scrolling branch February 24, 2024 20:45
@leonvogt

Copy link
Copy Markdown

Works like a charm, thanks @jayohms!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Scrollable elements are triggering pull to refresh

2 participants