Skip to content
This repository has been archived by the owner on Jul 8, 2024. It is now read-only.

Commit

Permalink
fix: add isBackgroundEvent to onSelectEvent event obj (jquense#2491)
Browse files Browse the repository at this point in the history
Adds isBackgroundEvent flag to 'event' objects passed to `onSelectEvent`. This allows the user to tailor their `onSelectEvent` methods for different functionality, if the selected `event` is a `backgroundEvent`
  • Loading branch information
cutterbl authored Jan 26, 2024
1 parent 276e450 commit fdbb496
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/DayColumn.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,16 @@ class DayColumn extends React.Component {
resource={this.props.resource}
selected={isSelected(event, selected)}
onClick={(e) =>
this._select({ ...event, sourceResource: this.props.resource }, e)
this._select(
{
...event,
...(this.props.resource && {
sourceResource: this.props.resource,
}),
...(isBackgroundEvent && { isBackgroundEvent: true }),
},
e
)
}
onDoubleClick={(e) => this._doubleClick(event, e)}
isBackgroundEvent={isBackgroundEvent}
Expand Down

0 comments on commit fdbb496

Please sign in to comment.