search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Scheduler - TypeError: Cannot read properties of undefined (reading 'left')

Asked by Anonymous
1 month ago.

Hi,
I'm getting the following error after loading data and binding them to the Scheduler:

TypeError: Cannot read properties of undefined (reading 'left')
    at Q.Et (vendor.js:791137:30)
    at keyboard.focusCell (vendor.js:791502:26)
    at DayPilot.Scheduler.Zc (vendor.js:781981:48)
    at R.doit (vendor.js:782007:255)
    at R.request (vendor.js:781996:102)
    at DayPilot.Scheduler.update (vendor.js:781992:11)
    at DayPilotSchedulerComponent.ngDoCheck (vendor.js:793138:20)
    at callHook (vendor.js:710321:12)
    at callHooks (vendor.js:710264:9)
    at executeCheckHooks (vendor.js:710173:3)

I can't tell exactly, when it happens. I'm calling the method focusCell only on selecting a range. And this works without an error.

onTimeRangeSelecting: (args) => {
      // Update the keyboard focus during time range selection (cell click)
      if (!args.row.data.frozen) {
        this.scheduler.control.keyboard.focusCell(args.start, args.resource);
      }
    },

I attached my Scheduler configuration. Maybe you can spot the cause of this error.

Comment posted by Dan Letecky [DayPilot]
1 month ago.

Could you please give it a try with the latest DayPilot Pro version (2022.3.5423)?

Please let me know if the problem persists.

Comment posted by Anonymous
1 month ago.

I tried it and the problem still persists.

TypeError: Cannot read properties of undefined (reading 'left')
    at X.Gt (daypilot-pro-angular.mjs:10147:499)
    at keyboard.focusCell (daypilot-pro-angular.mjs:10338:102)
    at DayPilot.Scheduler.bd (daypilot-pro-angular.mjs:6535:58)
    at R.doit (daypilot-pro-angular.mjs:6547:432)
    at R.request (daypilot-pro-angular.mjs:6543:185)
    at DayPilot.Scheduler.update (daypilot-pro-angular.mjs:6541:199)
    at DayPilotSchedulerComponent.ngDoCheck (daypilot-pro-angular.mjs:11140:26)
    at callHook (core.mjs:2587:18)
    at callHooks (core.mjs:2546:17)
    at executeCheckHooks (core.mjs:2478:5)
Comment posted by Dan Letecky [DayPilot]
1 month ago.

This seems to happen when the Scheduler tries to restore the keyboard focus after an update. It looks like it can happen if the timeline is empty (nothing on the horizontal axis) after the update. Can you confirm that?

Answer posted by Dan Letecky [DayPilot]
1 month ago.

The latest sandbox build (2022.3.5424) now includes a fix for this scenario. Could you please give it a try and let me know if it solves the issue?

Comment posted by Anonymous
1 month ago.

Yes, I confirm, that the timeline is empty and that now it works with the latest sandbox build (2022.3.5424).
Thank you very much

Comment posted by Dan Letecky [DayPilot]
1 month ago.

Great, thanks for the update!

New Reply
This reply is
Your name (optional):