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

How do I create different event behaviors for touch/click

Asked by Vincent
15 days ago.

I am trying to see if I can get the grid to work in the following way:

When touched using a touch pad/screen, an event would create a context menu.

When left clicked using a mouse, an event would be selected or launch some other code to load up this event.

When right clicked using a mouse, an event would create a context menu.

Is there a way to differentiate between a touch or a click in the click event, without also breaking the existing drag/drop behavior?

Answer posted by Dan Letecky [DayPilot]
10 days ago.

In the onEventClick and onEventClicked events, you can access the original event as args.originalEvent.

Using the original event object, you can check if the source was a touch event:

onEventClick: (args) => {
  const touch = !!args.originalEvent.changedTouches;
  // ...
},
New Reply
This reply is
Attachments:
or drop files here
Your name (optional):