mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Added persistentScrollbar prop in ScrollView component (#22300)
Summary: This PR is a follow-up from the closed [discussions-and-proposals PR](https://github.com/react-native-community/discussions-and-proposals/pull/39), that explains in more detail the rationale for adding this feature. Pull Request resolved: https://github.com/facebook/react-native/pull/22300 Reviewed By: fkgozali Differential Revision: D13121748 Pulled By: mdvacca fbshipit-source-id: 899641be79bdb41fa6649df0772c602a5e09b3b9
This commit is contained in:
committed by
Facebook Github Bot
parent
0c8db08f51
commit
d3f3bfa2a5
@@ -301,6 +301,13 @@ type AndroidProps = $ReadOnly<{|
|
||||
* @platform android
|
||||
*/
|
||||
overScrollMode?: ?('auto' | 'always' | 'never'),
|
||||
/**
|
||||
* Causes the scrollbars not to turn transparent when they are not in use.
|
||||
* The default value is false.
|
||||
*
|
||||
* @platform android
|
||||
*/
|
||||
persistentScrollbar?: ?boolean,
|
||||
|}>;
|
||||
|
||||
type VRProps = $ReadOnly<{|
|
||||
@@ -442,6 +449,7 @@ export type Props = $ReadOnly<{|
|
||||
* Note: Vertical pagination is not supported on Android.
|
||||
*/
|
||||
pagingEnabled?: ?boolean,
|
||||
|
||||
/**
|
||||
* When false, the view cannot be scrolled via touch interaction.
|
||||
* The default value is true.
|
||||
|
||||
@@ -175,6 +175,7 @@ type OptionalProps = {
|
||||
viewableItems: Array<ViewToken>,
|
||||
changed: Array<ViewToken>,
|
||||
}) => void,
|
||||
persistentScrollbar?: ?boolean,
|
||||
/**
|
||||
* Set this when offset is needed for the loading indicator to show correctly.
|
||||
* @platform android
|
||||
|
||||
+5
@@ -255,4 +255,9 @@ public class ReactHorizontalScrollViewManager
|
||||
public void setOverflow(ReactHorizontalScrollView view, @Nullable String overflow) {
|
||||
view.setOverflow(overflow);
|
||||
}
|
||||
|
||||
@ReactProp(name = "persistentScrollbar")
|
||||
public void setPersistentScrollbar(ReactHorizontalScrollView view, boolean value) {
|
||||
view.setScrollbarFadingEnabled(!value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -264,6 +264,11 @@ public class ReactScrollViewManager
|
||||
}
|
||||
}
|
||||
|
||||
@ReactProp(name = "persistentScrollbar")
|
||||
public void setPersistentScrollbar(ReactScrollView view, boolean value) {
|
||||
view.setScrollbarFadingEnabled(!value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable Map<String, Object> getExportedCustomDirectEventTypeConstants() {
|
||||
return createExportedCustomDirectEventTypeConstants();
|
||||
|
||||
Reference in New Issue
Block a user