furf / jquery-ui-touch-punch

A duck punch for adding touch events to jQuery UI
http://touchpunch.furf.com/
3.51k stars 1.33k forks source link

jQuery UI with touchpunch not fully working -> outdated #317

Open Johnny99211 opened 5 years ago

Johnny99211 commented 5 years ago

I'm currently trying to get the jQuery UI sortable function working on my Android phone (touch). Sadly, the touch event don't works on my phone. I've tried everything.

jQuery("#details-inner").sortable({
    handle: ".sort-section-handle",
    axis: "y",
    placeholder: "sort-placeholder",
    update: function (e, r) {
        var a = {action: "update_element_position", sec: jQuery(r.item).attr("data-section"), pos: r.item.index()};
        jQuery.post(cm_ajaxurl, a)
    }
});

jQuery("#details-inner .sort-section-handle").disableSelection();

I've included jQuery UI and also jQuery UI Touch Punch for the mobile touch support within WordPress this way:

wp_enqueue_script( 'jquery-ui-sortable' );
wp_enqueue_script( 'jquery-touch-punch' );

On the computer everything works great but not on my phone. On the phone it's scrolling the page when I'm trying to press the handle to move the section. Any idea what could be the problem? Maybe the handle?

Johnny99211 commented 5 years ago

I've tried out a very old jQuery UI version and it looks like that touchpunch don't works anymore with newer versions because with a really old version 1.8.21 it's working but also not that good because sorting with a handle don't works.

dexterial commented 5 years ago

it might be linked to the issue with the no click events, see my comments in #306

RWAP commented 5 years ago

It would be interesting to know if the latest version of my fork fixes this - https://github.com/RWAP/jquery-ui-touch-punch

vudayagirivaibhav commented 5 years ago

@RWAP it's working. just tested. Thank you.

kashemali commented 4 years ago

Capture When I try to move the dialog throw this error. Hope this would help you to solve the problem asap.

RWAP commented 4 years ago

Capture When I try to move the dialog throw this error. Hope this would help you to solve the problem asap.

Suggest you try the latest code - NOT this old code which has not been updated in severeal years.

https://github.com/RWAP/jquery-ui-touch-punch

If the latest code does not work then you need to open a NEW issue with details of the browser you are using etc.... Don't hijack another issue (which has actually been marked as complete!)