Skip to content

Commit 99c26e2

Browse files
authored
Merge pull request #33 from hannojg/feat/scrollview-add-scrollvar-position
feat: add `verticalScrollbarPosition` prop to `ScrollView`
2 parents 6e9d4bf + 95d3b1f commit 99c26e2

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewManager.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,4 +375,15 @@ public void setPointerEvents(ReactScrollView view, @Nullable String pointerEvent
375375
public void setScrollEventThrottle(ReactScrollView view, int scrollEventThrottle) {
376376
view.setScrollEventThrottle(scrollEventThrottle);
377377
}
378+
379+
@ReactProp(name = "verticalScrollbarPosition")
380+
public void setVerticalScrollbarPosition(ReactScrollView view, String position) {
381+
if ("right".equals(position)) {
382+
view.setVerticalScrollbarPosition(View.SCROLLBAR_POSITION_RIGHT);
383+
} else if ("left".equals(position)) {
384+
view.setVerticalScrollbarPosition(View.SCROLLBAR_POSITION_LEFT);
385+
} else {
386+
view.setVerticalScrollbarPosition(View.SCROLLBAR_POSITION_DEFAULT);
387+
}
388+
}
378389
}

0 commit comments

Comments
 (0)