Instant Results on Mobile Won't Scroll (1.13, Magento 1)

When viewing instant search results (Algolia 1.13, Magento 1) on Mobile, when I attempt to scroll up for more results, the screen touch is immediately captured as a click and the HREF is executed. Prior version allows for a scroll.

Hello @ronnie.reid !

Thanks a lot for reporting this issue.
We are currently working on a fix that will be released in the next version of our Magento1 extension.

Thanks again.
Best regards.

Here’s a helpful quick fix instead of waiting for the next deployment…

in the js/algoliasearch/autocomplete.js at line ~113 replace

			dropdown.$menu.on('touchstart', suggestionClass, function(e) {
				e.preventDefault();
				e.stopPropagation();
				
				var url = $(this).find('a').attr('href');
				location.assign(url);

with…

            var touchmoved;

			dropdown.$menu.on('touchend', suggestionClass, function (e) {
				if (touchmoved != true) {
					e.preventDefault();
					e.stopPropagation();

					var url = $(this).find('a').attr('href');
					location.assign(url);
				}
			}).on('touchmove', function (e) {
				touchmoved = true;
			}).on('touchstart', function (e) {
				touchmoved = false;

Enjoy!

1 Like