Skip to content

Commit

Permalink
Add ComponentDidUpdate Functionality (#11)
Browse files Browse the repository at this point in the history
The react-perfect-scrollbar works well on initial render, but
if the underlying content changes in size, the scrollbar size
does not update until you manually interact with the scrollbar.
By adding this function, the scrollbar will update any time
the content size changes.
  • Loading branch information
phil-dileo authored and goldenyz committed May 19, 2017
1 parent 0b750b7 commit d8da09b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/scrollbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ export default class ScrollBar extends Component {
});
}

componentDidUpdate() {
ps.update(this._container);
}

componentWillUnmount() {
// unhook up evens
Object.keys(this._handlerByEvent).forEach((value, key) => {
Expand Down

0 comments on commit d8da09b

Please sign in to comment.