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

month_transparent_event_hover repeating

Asked by Scott
1 year ago.

When I look at the DevTools Elements for one of my events on the monthly calendar I see many copies of the month_transparent_event_hover class, see attached image. When I mouse over the event the color gets slightly lighter but when I mouse out it doesn't change back.

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

Are you able to reproduce the issue in the online demo?
https://javascript.daypilot.org/demo/month/themetransparent.html

The function that is used to add add a class to a div element checks if the class is already present so this shouldn't happen.

Comment posted by Scott
1 year ago.

In the online demo it works correctly, I can see the class being added and removed. In my page I see the class being added but not removed. Each time I mouse over more of the classes are added. I could try to debug it if you can give me an idea of what code to look at, or I could email you the source of the page.

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

Before you start debugging, I recommend checking that you have the latest DayPilot Pro version.

Then, try checking your "theme" property value (or the legacy "cssClassPrefix"). Make sure that it doesn't include any spaces because that could affect the regex used to check if the class is already applied.

If that doesn't help, you can try searching the code for the following line:

DayPilot.Util.addClass(div, calendar._prefixCssClass("_event_hover"));

This is where the calendar applies the class. This is done repeatedly in onmouseover handler. If the check performed in addClass() fails, it could be added multiple times.

Comment posted by Scott
1 year ago.

I am using DayPilot Pro for JavaScript 2022.1.5175 which I see is not the latest version. How do I get the latest version? Attached is some info on what might be the problem,

Comment posted by Scott
1 year ago.

Here's some more info in attached doc. Even though the class is already added, when it tests to see if the class is already added, the test fails and it gets added again.

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

It looks like you have modified the source code - you should use the original (commented-out in your screenshot) regex:

var already = new RegExp("(^|\\s)" + name + "($|\\s)");
Comment posted by Scott
1 year ago.

Yes, that fixed it. I have no idea how that got changed...Thanks for the help!

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

Great, thanks for the update!

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