Skip to content
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

Fix scroll always appear on IE #116

Merged
merged 1 commit into from
Feb 10, 2017
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
4 changes: 2 additions & 2 deletions src/Scrollbars/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export default createClass({
const { view, trackHorizontal } = this.refs;
const { scrollWidth, clientWidth } = view;
const trackWidth = getInnerWidth(trackHorizontal);
const width = clientWidth / scrollWidth * trackWidth;
const width = Math.ceil(clientWidth / scrollWidth * trackWidth);
if (trackWidth === width) return 0;
if (thumbSize) return thumbSize;
return Math.max(width, thumbMinSize);
Expand All @@ -183,7 +183,7 @@ export default createClass({
const { view, trackVertical } = this.refs;
const { scrollHeight, clientHeight } = view;
const trackHeight = getInnerHeight(trackVertical);
const height = clientHeight / scrollHeight * trackHeight;
const height = Math.ceil(clientHeight / scrollHeight * trackHeight);
if (trackHeight === height) return 0;
if (thumbSize) return thumbSize;
return Math.max(height, thumbMinSize);
Expand Down