Author Topic: cellClick event won't trigger in mobile devices...  (Read 2349 times)

kiwon34

  • Pro Ultimate
  • Jr. Member
  • *
  • Posts: 52
    • View Profile
cellClick event won't trigger in mobile devices...
« on: August 29, 2017, 09:40:23 am »
Hi,

1. Is there another event for cellClick in mobile device? Here is an example, "http://jsfiddle.net/w3yzye9L/11/". The cellClick triggers on desktop browsers, but it wouldn't on my mobile device.

2. I was told to turn off the virtualY to false if I want to enable the touch scroll option on mobile device. But how do I display big data without the virtual option in mobile? Is there some other way to do it?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: cellClick event won't trigger in mobile devices...
« Reply #1 on: August 29, 2017, 11:13:56 am »
1. cellClick event is working fine ( fired ) in Android and iOS. Which mobile device are you using.

2. virtual mode can be turned on in mobile devices. Swipe scrolling is not supported in virtual mode but the grid can still be scrolled with use of scrollbars.
« Last Edit: August 29, 2017, 11:26:04 am by paramquery »

kiwon34

  • Pro Ultimate
  • Jr. Member
  • *
  • Posts: 52
    • View Profile
Re: cellClick event won't trigger in mobile devices...
« Reply #2 on: August 29, 2017, 11:54:22 am »
I found out that it works fine on IOS devices(iPhone, iPad), and also some other android devices such as nexus(Android version 8.0).

I am using Chrome browser in an Android device.(Samsung Galaxy Note5, Android version-7.0, chrome 60.0.3112.107)

When debugging the source code, it seems "this._touchMoved" becomes true when 'touchMove' event is triggered, so the click event won't trigger.
The source is as below.

touch-punch/touch-punch.dev.js
Code: [Select]
mouseProto._touchMove = function (event) {
    if ( !this._touchHandled ) {
      return;
    }
    this._touchMoved = true;
    simulateMouseEvent(event, 'mousemove');
  };
  mouseProto._touchEnd = function (event) {
    if ( !this._touchHandled ) {
      return;
    }
    simulateMouseEvent(event, 'mouseup');
    simulateMouseEvent(event, 'mouseout');
    if (!this._touchMoved) {
      simulateMouseEvent(event, 'click');
    }
    this._touchMoved = false;
    this._touchHandled = false;
    touchHandled = false;
    if(secondTap){
        simulateMouseEvent(event, 'dblclick');
    }
  };

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: cellClick event won't trigger in mobile devices...
« Reply #3 on: August 29, 2017, 01:12:04 pm »
It works fine on Android 6 too. There are so many mobile vendors, it's not feasible to test on every mobile device

Anyhow your issue could be related to distance option:

https://api.jqueryui.com/mouse/#option-distance

Please check it now: http://jsfiddle.net/w3yzye9L/14/