Skip to content

feat: Add onSync callback to ScrollSync #38

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 19, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/ScrollSync.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ import PropTypes from 'prop-types'
export default class ScrollSync extends Component {

static propTypes = {
/**
* Callback to be invoked any time synchronization happens
*
* @param {Element} el The element that has received the scroll event
*/
onSync: PropTypes.func,
children: PropTypes.element.isRequired,
proportional: PropTypes.bool,
vertical: PropTypes.bool,
Expand Down Expand Up @@ -132,6 +138,7 @@ export default class ScrollSync extends Component {
}
})
})
if (this.props.onSync) this.props.onSync(scrolledPane)
}

render() {
Expand Down