question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No background event eventClick fired when selectable

See original GitHub issue

Recreation on codepen https://codepen.io/straskal/pen/MxNbqW

Hi there!

When calendar.selectable is true, background events do not emit a click event because the day cell select takes precedence.

This becomes pretty undesirable when we want to allow users to modify background events, as well as easily add new background events through clicking and dragging (selectable).

I’m not too fond of the work around that is in place right now:

select: function (info) {
            var events = calendar.getEvents();

            for (var i = 0; i < events.length; i++) {
                if (events[i].rendering === 'background' && events[i].start < info.start && events[i].end > info.end) {
                        // Emulate click event on existing background event.
                        return;
                }
            }

           // Else do stuff to add a new background event in the selected region
        }

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
acerixcommented, Mar 28, 2019

Confirmed, thanks for the detailed report and workaround.

2reactions
douglaswardcommented, May 7, 2021

Setting selectMinDistance to 1 seems to solve it for me: clicking a background event fires the eventClick event and clicking and dragging a little fires the select event.

Read more comments on GitHub >

github_iconTop Results From Across the Web

fullCalendar eventClick not fired - Stack Overflow
I'm using fullcalendar in an app. I want to change cell background color by clicking on cell, but ...
Read more >
eventClick - Docs - FullCalendar
Triggered when the user clicks an event. ... Unlike some other event-related interactions, eventClick does not require the interaction plugin.
Read more >
Element: click event - Web APIs | MDN
Any click events will be fired at the underlying element(s) instead. See this live example for a demonstration. Known workarounds for this bug:....
Read more >
Understanding JavaScript Mouse Events By Examples
When you click an element, there are no less than three mouse events fire in the following sequence: ... JavaScript mouse event -...
Read more >
Event Click - Event Calendar | DayPilot Documentation
Double Clicks. Double clicks are detected automatically: no EventClick event will be fired if the second click happens within 300 ms: You can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found