support icon indicating copy to clipboard operation
support copied to clipboard

EventSegmentDrag not working if timeaxis config set with custom hours

Open taauntik opened this issue 9 months ago • 3 comments

Forum post

Hello everyone,

I’m using the timeAxis functionality to simulate working hours (8 AM – 4 PM). Normally, I display multiple users with different working hours (as in the example below), but to keep this example simple, I’ve included only one person.

My scenario: 1. I use a preset that shows a full week (Monday to Sunday). 2. I have an event that lasts, for example, 14 hours. 3. The user decides to split this event into two segments. 4. They right-click the event and select the “split” option. 5. The user then wants to move the second segment one hour later.

At this step, I simulate a bug (or maybe I just have a misconfiguration). When I start dragging the second segment, the console begins to generate error messages.

I’ve prepared a minimal reproducible example on CodePen.(https://codepen.io/daavidoo/pen/JojVzLE?editors=1010)

 timeAxis: {
    include: {
      hour: {
        from: 8,
        to: 16,
      },
    },
  },

Error from console

Uncaught (in promise) TypeError: Cannot read properties of null (reading 'x')
    at SchedulerPro.getStartEndDatesFromRectangle (schedulerpro.module.js?484303:363:300842)
    at EventSegmentDrag.resolveStartEndDates (schedulerpro.module.js?484303:363:969616)
    at EventSegmentDrag.updateDragContext (schedulerpro.module.js?484303:363:964355)
    at EventSegmentDrag.updateDragContext (schedulerpro.module.js?484303:363:1921429)
    at EventSegmentDrag.onDrag (schedulerpro.module.js?484303:363:957417)
    at DragHelper.trigger (schedulerpro.module.js?484303:310:96702)
    at DragHelper.update (schedulerpro.module.js?484303:310:1300954)
    at DragHelper.internalMove (schedulerpro.module.js?484303:310:1299662)
    at DragHelper.onMouseMove (schedulerpro.module.js?484303:310:1300221)
    at HTMLDocument.u (schedulerpro.module.js?484303:310:133335)

taauntik avatar Apr 08 '25 09:04 taauntik

Hi @taauntik - could you please give an indication of the priority of this issue, we're experiencing the same issue and it's a core part of our users' workflow.

vulevukusej avatar Apr 24 '25 12:04 vulevukusej

+1

marciogurka avatar Apr 24 '25 12:04 marciogurka

Test pushed to 11069-eventSegment branch

taauntik avatar Apr 24 '25 14:04 taauntik