No background event eventClick fired when selectable
See original GitHub issueRecreation 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:
- Created 4 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Confirmed, thanks for the detailed report and workaround.
Setting
selectMinDistance
to 1 seems to solve it for me: clicking a background event fires theeventClick
event and clicking and dragging a little fires theselect
event.