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
* feat: add onSync callback to resolve#87
* fix: should keep updateScroll as manual trigger api
* doc: update the README
* simplify code
Co-authored-by: Allen Yang <Goldenyz@hotmail.com>
Copy file name to clipboardexpand all lines: README.md
+7
Original file line number
Diff line number
Diff line change
@@ -79,6 +79,13 @@ All the callback 'onXXXX' can accept a parameter: the ref to the scrollbar conta
79
79
</PerfectScrollbar>
80
80
```
81
81
82
+
#### onSync
83
+
Invoked when `PerfectScrollbar` comp needs to sync the scrollbar container by invoking `ps.update()`(Basically, it is invoked in CDU lifecycle) and receive the internal `perfect-scroll` instance `ps` as parameter.
84
+
85
+
It is useful when you want to customize the sync logic in some scenarios, eg: debounce the invocation of `ps.update()`.
86
+
87
+
For more detail, please refer to [issue#87](https://github.com/goldenyz/react-perfect-scrollbar/issues/87) and the example directory.
88
+
82
89
#### React.HTMLAttributes
83
90
Any attributes defined in [React.HTMLAttributes](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react/index.d.ts#L1689) can be used for the component.
0 commit comments