Skip to content

Commit

Permalink
[fixed] better gutter width detection
Browse files Browse the repository at this point in the history
  • Loading branch information
jquense committed Nov 29, 2015
1 parent 1c6a481 commit 7922882
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/TimeGrid.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,14 @@ let TimeGrid = React.createClass({
let isRtl = this.props.rtl;
let header = this.refs.headerCell;
let width = this._gutterWidth
let gutterCells = [findDOMNode(this.refs.gutter), ...this._gutters]
let isOverflowing = this.refs.content.scrollHeight > this.refs.content.clientHeight;

this._gutterWidth = getWidth(findDOMNode(this.refs.gutter));
this._gutterWidth = Math.max(...gutterCells.map(getWidth));

if (width !== this._gutterWidth) {
width = this._gutterWidth + 'px';
this._gutters.forEach(node => node.style.width = width)
gutterCells.forEach(node => node.style.width = width)
}

if (isOverflowing) {
Expand Down

0 comments on commit 7922882

Please sign in to comment.