Bug? Events jump to wrong position in Timeline View when scrollable = true & no lightbox is used


#1

Hi,

I am battling an issue where the events jump to wrong lines in the timeline view. This can be observed right after creation + scroll but it also happens randomly upon scroll.

Setup:

  1. scrollable: true must be set on the timeline view
  2. lightbox must be disabled (i.e. onBeforeLightbox returns false)

How to reproduce:

  1. Here is the example: https://snippet.dhtmlx.com/b358prr7
  2. Begin creating-dragging a new event on line 1 (Room 1) and WHILE dragging change the section (let’s say move all the way to Room 5. Release the mouse. Result: event correctly created on Room 5.
  3. Scroll the view.

Expected result:
Event stays on Room 5

Real result:
Event jumps to Room 1

There seems to be something wrong with the scrollable rendering because when I turn the scrollable off, it works. Also, if the built-in lightbox is used, then it works fine, at least from what I saw from a quick testing. Why is this? This gives me hope that there is a quick workaround because…

I MUST use a custom lightbox and I MUST use scrollable so there is no way I can avoid it. This creates a huge problem for me at the moment so every feedback appreciated.
Thank you!


#2

Hello @fxfn ,

Thank you for the detailed description of the issue!
It’s a visual bug, that occurs if you are blocking the default lightbox. The event stays in the correct section, but due to the lack of rerenders, it displays in the incorrect section(the start one). We will research why it occurs. Currently, you can avoid it by manually rerender the scheduler from the onDragEnd event:
https://docs.dhtmlx.com/scheduler/api__scheduler_ondragend_event.html

The code may look like follows:

scheduler.attachEvent("onDragEnd", function(id, mode, e){
    scheduler.updateView()
});

Here is the updated demo:
https://snippet.dhtmlx.com/aa33ko2r