3

Background

I have a community page which displays a calendar by FullCalendar

The calendar is in a Lightning Component.

Both Salesforce Communities and FullCalendar support mobile devices.

When I access the community page using a mobile device I am unable to use touch events to create a calendar entry, even though FullCalendar has Touch Support

Looking in the code, I can see there are touch event handlers setup on:

  • document for touchstart and touchend and touchcancel
  • window for touchmove

These events must be conflicting with the FullCalendar touch events.

Here is an example calendar which can be used to debug:

It is possible to create events in the calendar when on desktop, but not mobile.

I've tried adding:

    document.addEventListener("touchstart", function (event) {
        event.preventDefault();
        console.log("touchstart: event.preventDefault()");
    }, false);

    document.addEventListener("touchend", function (event) {
        event.preventDefault();
        console.log("touchend: event.preventDefault()");
    }, false);

    document.addEventListener("touchcancel", function (event) {
        event.preventDefault();
        console.log("touchcancel: event.preventDefault()");
    }, false);

    window.addEventListener("touchmove", function (event) {
        event.preventDefault();
        console.log("touchmove: event.preventDefault()");
    }, false);

But I just got this error in the console:

[Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive.

And none of the calendar buttons worked anymore.

Questions

Is there any way to remove the Salesforce Communities touch event handlers? or is it impossible due to LockerService?

Any other suggestions regarding how I can get the calendar to work within a Salesforce Community?


Cross-posted to:

8
  • Did you try to set standardstylesheet to false? Dec 10 '18 at 9:29
  • Are you using it in visualforce or in lightning component? Dec 10 '18 at 15:38
  • @TusharSharma I've updated the question
    – Robs
    Dec 16 '18 at 21:36
  • 1
    Yes, I used your link. Both in Safari and Chrome, you can create an event if you long press.
    – Folkert
    Dec 21 '18 at 8:44
  • 1
    No, but that's not possible on a desktop either.
    – Folkert
    Dec 21 '18 at 9:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.