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

Daypilot AllowMultirange doesn't work with right click and context Menu

Asked by Anonymous
10 months ago.

We are developers of RTM.

When we set allowMultiRange to true and select a timerange and right click on the timerange the selected timerange disappears and only the cell you right clicked is selected. When we try to set the timerange with multirange.add after a right click . We get an error: Uncaught TypeError: i.elements.range2 is null. And it leads to strange behavior where the selecting goes where ever we go with the mouse despite no mouse button is clicked anymore.

If we make a change in the min.js in 2023.2.5592 where we add a check if i.elements.range2 is defined.

from
if(i.allowMultiRange)return i.elements.range2.overlapping?(C(i.elements.range2),i.elements.range2=null,i.Vp()):i.Vt.add(A),o.Ro=null,H||E.left&&i.Vt.dispatch(),void t();if(o.rt)return clearTimeout(o.rt),o.rt=null,void t();

to:
if(i.allowMultiRange && i.elements.range2)return i.elements.range2.overlapping?(C(i.elements.range2),i.elements.range2=null,i.Vp()):i.Vt.add(A),o.Ro=null,H||E.left&&i.Vt.dispatch(),void t();if(o.rt)return clearTimeout(o.rt),o.rt=null,void t();

the multirange.add after a right click seems to work.
Is it possible to fix that in the next Version?

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

Thanks for reporting the issue.

I wasn't able to reproduce the problem but the additional check is now added in the latest sandbox build (2023.2.5594).

Also, the right click behavior is fixed - it is now consistent with the standard behavior when allowMultiRange is disabled. It will not clear the selection and it will fire onTimeRangeRightClick and onTimeRangeRightClicked for the selection.

See also:
https://release.daypilot.org/changes/js/

Please let me know if the issue persists.

Answer posted by Anonymous
10 months ago.

Thanks for the fast response! The new release works for me.

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.