Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Feb 24, 2024

Conversation

jayohms
Copy link
Collaborator

@jayohms jayohms commented Feb 24, 2024

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
1 check passed
@jayohms jayohms deleted the webview-element-scrolling branch February 24, 2024 20:45
@leonvogt
Copy link

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