Skip to content

Commit

Permalink
fix: Correct variable name that gets passed on to EventWrapper so dra…
Browse files Browse the repository at this point in the history
…gndrop ha… (#2121)

Fix variable name that gets passed on to EventWrapper so dragndrop has access to continuesPrior and continuesAfter flags.
Based on these flags, drag n drop determine whether to show north-south anchors
for multi day events.
  • Loading branch information
dhruvgoel92 authored Feb 10, 2022
1 parent cb3556b commit 19294de
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
1 change: 1 addition & 0 deletions examples/demos/dnd.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ class Dnd extends React.Component {
onEventDrop={this.moveEvent}
resizable
onEventResize={this.resizeEvent}
showMultiDayTimes={true}
onSelectSlot={this.newEvent}
onDragStart={console.log}
defaultView={Views.MONTH}
Expand Down
4 changes: 2 additions & 2 deletions examples/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ export default [
},
{
id: 11.1,
title: 'Inconvenient Conference Call',
title: 'Inconvenient multi-day Conference Call',
start: new Date(2015, 3, 13, 9, 30, 0),
end: new Date(2015, 3, 13, 12, 0, 0),
end: new Date(2015, 3, 14, 1, 0, 0),
},
{
id: 11.2,
Expand Down
8 changes: 4 additions & 4 deletions src/DayColumn.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@ class DayColumn extends React.Component {
if (startsBeforeDay && startsAfterDay) label = messages.allDay
else label = localizer.format({ start, end }, format)

let continuesEarlier = startsBeforeDay || slotMetrics.startsBefore(start)
let continuesLater = startsAfterDay || slotMetrics.startsAfter(end)
let continuesPrior = startsBeforeDay || slotMetrics.startsBefore(start)
let continuesAfter = startsAfterDay || slotMetrics.startsAfter(end)

return (
<TimeGridEvent
Expand All @@ -233,8 +233,8 @@ class DayColumn extends React.Component {
getters={getters}
rtl={rtl}
components={components}
continuesEarlier={continuesEarlier}
continuesLater={continuesLater}
continuesPrior={continuesPrior}
continuesAfter={continuesAfter}
accessors={accessors}
selected={isSelected(event, selected)}
onClick={e => this._select(event, e)}
Expand Down
8 changes: 4 additions & 4 deletions src/TimeGridEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ function TimeGridEvent(props) {
rtl,
selected,
label,
continuesEarlier,
continuesLater,
continuesPrior,
continuesAfter,
getters,
onClick,
onDoubleClick,
Expand Down Expand Up @@ -76,8 +76,8 @@ function TimeGridEvent(props) {
userProps.className,
{
'rbc-selected': selected,
'rbc-event-continues-earlier': continuesEarlier,
'rbc-event-continues-later': continuesLater,
'rbc-event-continues-earlier': continuesPrior,
'rbc-event-continues-later': continuesAfter,
}
)}
>
Expand Down
4 changes: 2 additions & 2 deletions src/addons/dragAndDrop/EventContainerWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ class EventContainerWrapper extends React.Component {
getters={getters}
components={{ ...components, eventWrapper: NoopWrapper }}
accessors={{ ...accessors, ...dragAccessors }}
continuesEarlier={startsBeforeDay}
continuesLater={startsAfterDay}
continuesPrior={startsBeforeDay}
continuesAfter={startsAfterDay}
/>
)}
</React.Fragment>
Expand Down

0 comments on commit 19294de

Please sign in to comment.