Skip to content

onTimeChange called before onItemDrag #838

@atheck

Description

@atheck

Describe the bug

When dragging an item, onTimeChange is called just before onItemDrag. This happens only randomly.

In my case this unnecessarily causes reloading of data. When this happens, the moved item gets "recreated" and jumps back to the start position before dragging.

To Reproduce

<Timeline
    groups={groups}
    items={items}
    onItemDrag={() => console.log("onItemDrag")}
    onTimeChange={() => console.log("onTimeChange")}
/>

Sometimes this will print:

onTimeChange
onItemDrag

Expected behavior

onTimeChange should not be called before dragging an item.

Library Version

"react-calendar-timeline": "0.27.0"

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Firefox, Chrome
  • Version: latest

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions