iou90 / react-native-autoheight-webview

An auto height webview for React Native
ISC License
492 stars 162 forks source link

Scrolling on android jumps down to the top of the webview after the webview height has increased #240

Closed ahaverty closed 2 years ago

ahaverty commented 2 years ago

Bug description: Scrolling on android jumps down to the top of the webview, after the webpage's height is increased (e.g via an expanded accordion in the webview)

To Reproduce: With a webview of a webpage, containing expandable accordion views. Expand one of the accordion's in the webview, and attempt to scroll to the top of the react native scrollview page.

Expected behavior: Expect the page to scroll back to the top without shooting back down. Notably, this works well on iOS.

Screenshots/Videos: First 10 seconds showing scroll works as expected initially. Last 15 seconds showing how scroll jumps down the page after the accordion in the webview was expanded. Effectively preventing a user from scrolling back to the top of the outer scrollview.

Edit: Redacted slightly sensitive video, apologies but perhaps see my below comment on our 'fix'

Environment:

iou90 commented 2 years ago

Please provide a minimal simple html/uri to reproduce this issue.

ahaverty commented 2 years ago

Thanks @iou90 , we've since discovered the issue was due to an animated value for adjusting the header padding in our react native view. Removing this, scrolling now works well on both platforms. Thanks for checking in!