Skip to content

Commit

Permalink
fix: temp fix for DayColumn render (jquense#2224)
Browse files Browse the repository at this point in the history
This will work until we can refactor as a
functional component with hooks

Closes jquense#2222
  • Loading branch information
cutterbl authored Jul 12, 2022
1 parent fe552b6 commit 48b23a2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/DayColumn.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ class DayColumn extends React.Component {
this.clearTimeIndicatorInterval()
}

componentDidUpdate(prevProps, prevState) {
getSnapshotBeforeUpdate(prevProps) {
if (!prevProps.selectable && this.props.selectable) this._selectable()
if (prevProps.selectable && !this.props.selectable)
this._teardownSelectable()
}

this.slotMetrics = this.slotMetrics.update(this.props)

componentDidUpdate(prevProps, prevState) {
const { getNow, isNow, localizer, date, min, max } = this.props
const getNowChanged = localizer.neq(prevProps.getNow(), getNow(), 'minutes')

Expand Down Expand Up @@ -115,7 +115,7 @@ class DayColumn extends React.Component {
components: { eventContainerWrapper: EventContainer, ...components },
} = this.props

let { slotMetrics } = this
let slotMetrics = this?.slotMetrics?.update?.(this.props) ?? {}
let { selecting, top, height, startDate, endDate } = this.state

let selectDates = { start: startDate, end: endDate }
Expand Down

0 comments on commit 48b23a2

Please sign in to comment.