Skip to content

Commit

Permalink
Merge pull request #840 from aij/master
Browse files Browse the repository at this point in the history
Fix scrollMenuIntoView option
  • Loading branch information
JedWatson committed Apr 9, 2016
2 parents 0257628 + 65661b3 commit 27d5e67
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ const Select = React.createClass({
if (this.props.scrollMenuIntoView && this.refs.menuContainer) {
var menuContainerRect = this.refs.menuContainer.getBoundingClientRect();
if (window.innerHeight < menuContainerRect.bottom + this.props.menuBuffer) {
window.scrollTo(0, window.scrollY + menuContainerRect.bottom + this.props.menuBuffer - window.innerHeight);
window.scrollBy(0, menuContainerRect.bottom + this.props.menuBuffer - window.innerHeight);
}
}
if (prevProps.disabled !== this.props.disabled) {
Expand Down

0 comments on commit 27d5e67

Please sign in to comment.