RWAP / jquery-ui-touch-punch

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

jQuery UI Sortable #17

Open hirenshah opened 4 years ago

hirenshah commented 4 years ago

I came across this after researching a fix for WordPress jQuery UI Sortable not actually being sortable on mobile devices (trying to tap and drag it does nothing).

If I use a mouse, (I paired a BlueTooth one to my phone), all the click events work as expected.

I've tried swapping out WP's default jQuery, TouchPunch etc newer versions, but that didn't help in any way.

Is there anything I'm overlooking here?

RWAP commented 4 years ago

Did you use the latest jquery ui and this version of touchpunch - not the one from the main furf repository (which has not been updated in years)?

It works fine for others, so it might be something in the Wordpress plugin - ensure you are also loading in the correct order:

JQuery JQuery UI TouchPunch

hirenshah commented 4 years ago

Yes, I am using the latest version of jQuery UI (I have deregistered the WP versions and registered the new version), as well as done the same for TouchPunch.

I've set the function priorities so that TouchPunch is loaded last, but it doesn't seem to have helped.

Would you be able to suggest how I can confirm they are being loaded in the correct order?

RWAP commented 4 years ago

Sorry - am not sure - does the browser console reveal anything?

It could of course be another plugin which may be preventing touchpunch

hirenshah commented 4 years ago

I've been faffing around with this for days now. I've ensured that it is being loaded right at the end, especially after 'jquery-ui-mouse'.

I'm experiencing this issue with the ACF Gallery field, so have been talking to ACF's developers. The field has actions for both tap (opens a sidebar) as well as hold and drag for sorting. When you first load the page, you can tap, which opens a side panel. If you close the side panel, you can no longer tap to reopen it, but you can still sort items.

It sounds like an ACF issue, but I'm confused as to why when using a mouse with my phone, the interaction is as you would expect.

By simply implementing this version of TouchPunch (and nothing else), the behaviour changes. I am no longer able to hold and drag (at all), but the tap to open the side panelworks perfectly every time.

I did look into updating jQuery UI but WordPress has all the UI and Effects components registered separately and it seems overly complicated to deregister all of them, and re-register in the correct order :(

RWAP commented 3 years ago

Did you manage to resolve this issue?

mbrandt00 commented 2 years ago

I'm having a similar issue here.