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

Time Range Click with multi range not working

Asked by Radu M
10 days ago.

Hello DayPilot Team,

I’m sorry if this is not a bug but I could not find any information regarding the issue that I am having.

I am working on a project that is using daypilot-pro-react v2024.4.6294 and I wanted to use onTimeRangeClicked event instead of onTimeRangeSelected to handle event creation but I discovered that setting allowMultiRange: true in the scheduler config somehow makes the following events do nothing: onTimeRangeClick, onTimeRangeClicked, onTimeRangeDoubleClick and onTimeRangeDoubleClicked.

With the same setting enabled onTimeRangeRightClick and onTimeRangeRightClicked events do work as in executing the provided function but the data provided by them is just for the time range that was right clicked on and there is no list provided for all the ranges that are selected.

For reproduction I attached a file where I took the code from Next.js Scheduler with DayPilot and just set allowMultiRange and then added console logs for the events mentioned above.

I could not find any mentions in the documentation regarding some kind of limitation between time range click handling and multi time ranges.

Thank you for your help.

Kind regards,

Radu M.

Answer posted by Dan Letecky [DayPilot]
10 days ago.

These events are fired for the current selection (the one you click), but you can always get all selected time ranges using the multiselect.get() method.

Please let me know if this is not what you are looking for.

Comment posted by Radu M
10 days ago.

I would be fine with that but if I provide a function to onTimeRangeClicked for example that one is not called.

Comment posted by Dan Letecky [DayPilot]
10 days ago.

Please let me check that.

Comment posted by Dan Letecky [DayPilot]
10 days ago.

I confirm the bug. The onTimeRangeClick/ed and onTimeRangeDoubleClick/ed events were not firing properly.

This issue should be fixed now in the latest sandbox build (2024.4.6298).

Please let me know if the problem persists.

Comment posted by Radu M
10 days ago.

I checked the sandbox build (2024.4.6298) and can confirm the events trigger now. If I find another problem on this after the full release on 15 I will come back :) .

One last thing I observed is that after I make a normal time range selection then pressing CTRL when I release the key onTimeRangeSelected is triggered even if i have the focus somewhere else on the page (the range selected is still visible in the scheduler). If I spam the key on every release the event is triggered. Is that normal?

I used the same code as my first post; if you need I can make a sort clip to show it happening.

Comment posted by Dan Letecky [DayPilot]
10 days ago.

Good, thanks for the update!

This Ctrl behavior is not normal - but it should be fixed now as well (2024.4.6299).

New Reply
This reply is
Attachments:
or drop files here
Your name (optional):