Skip to content

Commit

Permalink
fix scrollToChild on Android
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeymild authored Dec 5, 2023
1 parent 495a437 commit ecbd4b1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions android/src/main/java/com/jsiviewhelpers/Scroller.kt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ object Scroller {
if (scrollView == null) return@runOnUiThread
val childView = ReactFindViewUtil.findView(scrollView, childNativeID)
?: return@runOnUiThread
if (scrollView is ReactSwipeRefreshLayout) {
scrollView = scrollView.getChildAt(0)
}
if (scrollView is ReactScrollView) {
scrollView.scrollTo(childView, scrollToEnd, offset.toInt())
} else if (scrollView is ReactHorizontalScrollView) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-jsi-view-helpers",
"version": "1.0.1",
"version": "1.0.2",
"description": "React Native Jsi view helpers",
"main": "src/index",
"module": "src/index",
Expand Down

0 comments on commit ecbd4b1

Please sign in to comment.