Skip to content
Merged
Show file tree
Hide file tree
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
14 changes: 10 additions & 4 deletions src/time.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ export default class Time extends React.Component {
);
};

state = {
height: null
}

componentDidMount() {
// code to ensure selected time will always be in focus within time window when it first appears
this.list.scrollTop = Time.calcCenterPosition(
Expand All @@ -51,6 +55,11 @@ export default class Time extends React.Component {
: this.list.clientHeight,
this.centerLi
);
if (this.props.monthRef && this.header) {
this.setState({
height: this.props.monthRef.clientHeight - this.header.clientHeight
});
}
}

handleClick = time => {
Expand Down Expand Up @@ -143,10 +152,7 @@ export default class Time extends React.Component {
};

render() {
let height = null;
if (this.props.monthRef && this.header) {
height = this.props.monthRef.clientHeight - this.header.clientHeight;
}
const { height } = this.state;

return (
<div
Expand Down
7 changes: 4 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -999,9 +999,10 @@ babel-plugin-transform-react-jsx@^6.24.1:
babel-plugin-syntax-jsx "^6.8.0"
babel-runtime "^6.22.0"

babel-plugin-transform-react-remove-prop-types@^0.4.19:
version "0.4.20"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-remove-prop-types/-/babel-plugin-transform-react-remove-prop-types-0.4.20.tgz#688bdea1e27ea0023775dea817fa2d3f8df8802b"
babel-plugin-transform-react-remove-prop-types@^0.4.24:
version "0.4.24"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-remove-prop-types/-/babel-plugin-transform-react-remove-prop-types-0.4.24.tgz#f2edaf9b4c6a5fbe5c1d678bfb531078c1555f3a"
integrity sha512-eqj0hVcJUR57/Ug2zE1Yswsw4LhuqqHhD+8v120T1cl3kjg76QwtyBrdIk4WVwK+lAhBJVYCd/v+4nc4y+8JsA==

babel-plugin-transform-regenerator@^6.22.0:
version "6.26.0"
Expand Down