Events change height after click when recurrence enabled and event_dy full (timeline view)

Hi,

My events change height after click when recurrence is enabled and the timeline uses the event_dy: full setting. The inline style indicates the height is returning NaN which seems to be correct (“correct” as “by looking at your code”):

if (!ev._inner && this.event_dy == "full") {
	hb=(hb+2)*(ev._count-sorder)-2;
}

That’s the scheduler.render_timeline_event function. Both ev._count and sorder (which is ev._sorder) are undefined. Why is this?

Here is an example: https://snippet.dhtmlx.com/705r9qlj

Steps to reproduce:

  1. Click on an event

Result:
Event changes height because of a wrong CSS rule

Expected result:
Event still the same height (i.e. ‘full’)

Am I missing something or is this a bug? Thank you.

Hi @fxfn ,

It looks like a bug on our end(or some unexpected behavior), thank you for noticing it!
I sent it to our dev team, and they will research this issue. I will post any updates on this thread.

Kind regards,

Hi @Siarhei,

Some workaround would be greatly appreciated.

This is quite inconvenient as it actually creates a new event instead of editing an existing one, so if you don’t pay attention & click ok in the dialog/lightbox it submits and then you have to manually delete it (which does happen, sadly).

Thanks!

Hi @fxfn ,

Unfortunately, I can’t provide any workaround, as the issue is quite complicated and connected with creating the recurring event with the addEventMethod.

The dev team works on it and I will post any updates on this thread.

Kind regards,

Hello @fxfn,

You can manually clear the milliseconds part to avoid this issue, the code may look like follows:

function clearMilliseconds(date) {
			return new Date(
				date.getFullYear(),
				date.getMonth(),
				date.getDate(),
				date.getHours(),
				date.getMinutes(),
				date.getSeconds(),
				0
			);
		};

		var addEvent = scheduler.addEvent;
		scheduler.addEvent = function (obj) {
			if (obj) {
				if (obj.start_date) {
					obj.start_date = clearMilliseconds(obj.start_date);
				}
				if (obj.end_date) {
					obj.end_date = clearMilliseconds(obj.end_date);
				}
			}
			return addEvent.apply(this, arguments);
		};

Here is a demo with a workable workaround:
https://snippet.dhtmlx.com/5/ba64de0e3

Kind regards,

Hi @Siarhei

This doesn’t seem to work. You are not using event_dy: ‘full’ in your example. Set it on your view’s config, dbl click the 2nd event and it will behave exactly the same as before (=it will shrink).

Edit: oh wait, is this still 5.3.12 in use in your example? Is that the problem?

Hi @fxfn,

Oh, looks like there were two unconnected issues - the first one that caused an unexpected event creating if the milliseconds part isn’t clear:
https://recordit.co/ExiSTFsRxj
and the second one, that caused event shrink.

The dev team worked on the first one as it was quite critical. I notified them about the second one and they will work on a fix.

Kind regards,

Hi @Siarhei,

Oh I see what you mean. To be honest I didn’t realize that! :slight_smile: I gotta try whether this affects us and put the override in place.

Yep, the issue that I was reporting is that when you double-click the event with eveny_dy: full it shrinks the event in height which basically means you most likely “double clicked the scheduler body” (thus you get the lightbox of a NEW event instead of editing the existing one you intended to edit by double clicking).