• Resolved pimschaaf

    (@pimschaaf)


    Hi,

    I found that the change-trigger on wp-content\plugins\ics-calendar\assets\script.js line 292 hides the first month in the calendar display.

    Disabling or moving it above line 291 correctly shows the current month on page load.

    I’m wondering if this is a compatibility error or if this can be reproduced in other installs. Putting this out here for that purpose.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author room34

    (@room34)

    Would you be able to share a link to your site where the calendar appears? This is code that affects literally every site that is using the plugin with month view, and this is the first I’ve heard of this being an issue. That doesn’t mean you’re not experiencing it, but it suggests it’s something specific to (but maybe not unique to) your site.

    In principle it seems better to have these two lines in the order they’re in, so I’d like to dig in a bit further on what’s causing the problem for you before making a change to the plugin.

    Thread Starter pimschaaf

    (@pimschaaf)

    Thanks for your response. I could imagine it is something specific to this site and you having had no problems like it indeed suggest the same.

    I’ll try to make a reduced example and post that here as soon as I have time.

    It might help if you could elaborate on the logic of those two/three lines (290-292) of JS code, what is their exact purpose?

    Thanks!

    Thread Starter pimschaaf

    (@pimschaaf)

    Further testing points in the direction of a compatibility issue with jQuery Nice Select as implemented in Real Estate 7 theme.

    Changing wp-content\plugins\ics-calendar\assets\script.js:292 from

    jQuery('.ics-calendar.layout-month .ics-calendar-select').trigger('change');

    to

    jQuery('.ics-calendar.layout-month .ics-calendar-select:not(.nice-select)').trigger('change');

    fixes the loading display by preventing the Nice Select duplicated ‘nice’ select box from triggering the change event for the second time on page load.

    • I cannot reproduce the issue in a minimal setup based on TwentyTwentyOne child theme with jQuery Nice Select. The duplicated select box does not trigger another change event there.
    • I am not quite sure which mechanism in the ICS Calendar change handler would hide the first displayed month when it is triggered. This might be something you could help out with.
    • I haven’t yet been able to find why this issue emerges in the RealEstate 7 theme.

    In the end I think this is an issue for the theme developer to resolve, but I’ll keep this issue open for a little bit in case you would have any hints that could help point anyone in the right direction.

    Thanks!

    • This reply was modified 3 years, 4 months ago by pimschaaf.
    Plugin Author room34

    (@room34)

    Thanks for the additional information. I haven’t worked with jQuery Nice Select… do you happen to know if it is hiding the entire select element and replacing it with some other kind of stylized container? (I believe that’s how Select2 works, and I assume this is more-or-less the same.)

    It probably would be a good idea for me to try to make ICS Calendar “play nice” with select customizers like this, although that could be a bit of a fool’s errand. I just wish browsers had better styling for select tags so these types of workaround solutions weren’t needed!

    Thread Starter pimschaaf

    (@pimschaaf)

    It works in Twentytwentyone, so there’s more going on in the RealEstate 7 theme (or the child theme customizations that have been made to RE7 in my project) that might be the root cause of this issue.

    Yes, jQuery Nice Select is hiding the entire original select element and replacing it. It shouldn’t matter as the ‘fake’ select should trigger all events on the original select.

    That said, there will be a double .ics-calendar-select in the DOM, which might mess with assumptions (if any have been made) in using jQuery’s next(), prev() etc.. Issues like that might be preventable in ICS Calendar. Again, I don’t think that is the issue here.

    Keep up the good work!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘First month stays hidden’ is closed to new replies.