jquery-ui-touch-punch icon indicating copy to clipboard operation
jquery-ui-touch-punch copied to clipboard

jQuery UI with touchpunch not fully working -> outdated

Open Johnny99211 opened this issue 5 years ago • 6 comments

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 avatar Jun 03 '19 08:06 Johnny99211

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.

Johnny99211 avatar Jun 03 '19 21:06 Johnny99211

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

dexterial avatar Jun 05 '19 05:06 dexterial

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

RWAP avatar Jul 06 '19 15:07 RWAP

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

vudayagirivaibhav avatar Aug 06 '19 23:08 vudayagirivaibhav

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

kashemali avatar Mar 02 '20 16:03 kashemali

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!)

RWAP avatar Mar 02 '20 16:03 RWAP