Skip to content

Commit

Permalink
fix: hide indicator when current time is not in the interval (#1639)
Browse files Browse the repository at this point in the history
  • Loading branch information
kvbrg authored May 12, 2020
1 parent 841cdcb commit 92974bf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/DayColumn.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ class DayColumn extends React.Component {

if (current >= min && current <= max) {
const top = this.slotMetrics.getCurrentTimePosition(current)
this.intervalTriggered = true
this.setState({ timeIndicatorPosition: top })
} else {
this.clearTimeIndicatorInterval()
Expand Down Expand Up @@ -163,7 +164,7 @@ class DayColumn extends React.Component {
<span>{localizer.format(selectDates, 'selectRangeFormat')}</span>
</div>
)}
{isNow && (
{isNow && this.intervalTriggered && (
<div
className="rbc-current-time-indicator"
style={{ top: `${this.state.timeIndicatorPosition}%` }}
Expand Down

0 comments on commit 92974bf

Please sign in to comment.