Skip to content

Commit

Permalink
Merge dc1931a into e0f7b57
Browse files Browse the repository at this point in the history
  • Loading branch information
niktechnopro committed Oct 5, 2022
2 parents e0f7b57 + dc1931a commit 9f80bf0
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/time.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,14 @@ export default class Time extends React.Component {

componentDidMount() {
// code to ensure selected time will always be in focus within time window when it first appears
this.list.scrollTop = Time.calcCenterPosition(
this.props.monthRef
? this.props.monthRef.clientHeight - this.header.clientHeight
: this.list.clientHeight,
this.centerLi
);
this.list.scrollTop =
this.centerLi &&
Time.calcCenterPosition(
this.props.monthRef
? this.props.monthRef.clientHeight - this.header.clientHeight
: this.list.clientHeight,
this.centerLi
);
if (this.props.monthRef && this.header) {
this.setState({
height: this.props.monthRef.clientHeight - this.header.clientHeight,
Expand Down

0 comments on commit 9f80bf0

Please sign in to comment.