Survey Addon Rank Field in Mobile? [RESOLVED]

Just created a survey using the addon. Works as expected in the desktop, but on mobile the drag & drop functionality for the rank field doesn’t seem to work. I’m wondering if this addon is the best solution for a survey. Seems a little rough around the edges.

Hello jdatillio. Apple has been spoofing the user agent when loading a site in Safari or embedded browser in an iOS app. I believe the crux of the issue is we rely on the built in WordPress function wp_is_mobile() to detect if the user is on a mobile/touchscreen device, and then include a JavaScript library that adds support for the drag and drop on touch device. The spoofed user agent prevents this from happening as Gravity Forms and WordPress see the device as a desktop.

This is currently in the Product team’s list of active issues, but I’m afraid I would not be able to provide an ETA on when a fix would be available.

There may be a workaround though (untested.) You could try adding this to your theme functions.php file to enqueue the missing script:

add_action( 'wp_enqueue_scripts', 'load_touch_punch_js', 35 );
function load_touch_punch_js() {
	wp_enqueue_script( 'jquery-touch-punch' );
}

If that does not work, I’m afraid I don’t have any workaround for you. This is a change by Apple and a WordPress core issue as well that affects the touch functionality used by the Survey Rank field:

https://core.trac.wordpress.org/ticket/48425

If you have any other questions, please open a support ticket here:
https://www.gravityforms.com/open-support-ticket/technical/

Thank you.

That did solve the problem on the iPhone!

1 Like