Skip to content

Commit

Permalink
fix: item preview inside cell while dragging from outside not working… (
Browse files Browse the repository at this point in the history
jquense#1770)

* fix: item preview inside cell while dragging from outside not working properly

* switched moveEvent, newEvent to arrow functions inside dnd from outside exmaple

Co-authored-by: ismajlramadani <helloismajl@gmail.com>
  • Loading branch information
ismajl-polymath and ismajl-ramadani committed Oct 8, 2020
1 parent 5f155f7 commit 8fd6329
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions examples/demos/dndOutsideSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class Dnd extends React.Component {
this.newEvent(event)
}

moveEvent({ event, start, end, isAllDay: droppedOnAllDaySlot }) {
moveEvent = ({ event, start, end, isAllDay: droppedOnAllDaySlot }) => {
const { events } = this.state

const idx = events.indexOf(event)
Expand Down Expand Up @@ -107,7 +107,7 @@ class Dnd extends React.Component {
//alert(`${event.title} was resized to ${start}-${end}`)
}

newEvent(event) {
newEvent = event => {
let idList = this.state.events.map(a => a.id)
let newId = Math.max(...idList) + 1
let hour = {
Expand Down
2 changes: 1 addition & 1 deletion src/addons/dragAndDrop/WeekWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class WeekWrapper extends React.Component {
}

handleMove = ({ x, y }, node, draggedEvent) => {
const { event = draggedEvent } = this.context.draggable.dragAndDropAction
const event = this.context.draggable.dragAndDropAction.event || draggedEvent
const metrics = this.props.slotMetrics
const { accessors } = this.props

Expand Down

0 comments on commit 8fd6329

Please sign in to comment.