You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- The wrapped component must be a Class-based component, not a functional one, because `Autoscroll` uses a `ref`.
71
71
- This package is agnostic about any CSS you use. However, it assumes that you provide the adequate CSS to make the wrapped component have a scroll bar. (ie. `overflow-y:scroll;` and a set `height`)
72
72
73
-
## options
73
+
## props
74
+
75
+
The `autoscroll` higher-order-component supports the followig props
74
76
75
-
Optional props:
77
+
|name|default|description|
78
+
|-|-|-|
79
+
|OnScrolled|`undefined`|called without arguments whenever the list is scrolled|
80
+
|OnScrolledTop|`undefined`|called without arguments whenever the list is scrolled to the top|
76
81
77
-
-`onScrolled`: called whenever the list is scrolled. This is not an event listener.
78
-
-`onScrolledTop`: called when the list is scrolled to the top.
79
-
Pass these props when rendering the wrapped list component.
When creating a component by calling the `autoscroll` higher-order-component, an options object can be passed in as the second argument. It may contain the following keys:
82
85
83
-
The `isScrolledDownThreshold` option is used when determining whether the user has scrolled back to the bottom. If the element's `scrollBottom` is within `isScrolledDownThreshold`px of the maximum scroll (`scrollHeight`), the component will scroll down on the next updates.
84
-
This option exists because scrolling almost all the way down, but not entirely, can be interpreted as a sign that the user intends to see the bottom of the list.
85
-
Set it to 0 to enforce scrolling all the way down.
86
+
|name|default|description|
87
+
|-|-|-|
88
+
|isScrolledDownThreshold|150(px)|Used when determining whether the user has scrolled back to the bottom. If the element's `scrollBottom` is within `isScrolledDownThreshold`px of the maximum scroll (`scrollHeight`), the component will scroll down on the next updates. This option exists because scrolling almost all the way down, but not entirely, can be interpreted as a sign that the user intends to see the bottom of the list. Set it to 0 to enforce scrolling all the way down. |
0 commit comments