diff --git a/components/time_picker/Clock.jsx b/components/time_picker/Clock.jsx index eede27ec..b56e8efe 100644 --- a/components/time_picker/Clock.jsx +++ b/components/time_picker/Clock.jsx @@ -30,7 +30,9 @@ class Clock extends React.Component { componentDidMount () { window.addEventListener('resize', this.handleCalculateShape); - this.handleCalculateShape(); + setTimeout(() => { + this.handleCalculateShape(); + }); } componentWillUnmount () { diff --git a/components/time_picker/ClockHand.jsx b/components/time_picker/ClockHand.jsx index 88576df0..8e465313 100644 --- a/components/time_picker/ClockHand.jsx +++ b/components/time_picker/ClockHand.jsx @@ -27,7 +27,9 @@ class Hand extends React.Component { }; componentDidMount () { - this.setState({knobWidth: this.refs.knob.offsetWidth}); + setTimeout(() => { + this.setState({knobWidth: this.refs.knob.offsetWidth}); + }); } componentWillUnmount () {