autocomplete icon indicating copy to clipboard operation
autocomplete copied to clipboard

Autocomplete delay option is not honoured

Open moloughlin opened this issue 7 years ago • 2 comments

$(algoliaConfig.autocomplete.selector).each(function (i) {
	var options = {
		dropdownMenuContainer: "#algolia-autocomplete-container",
		debug: algoliaConfig.autocomplete.isDebugEnabled,
		delay: 400,
		minLength: 2
	};

	$(this).autocomplete(options, sources);
});

Since this is just a jQuery UI autocomplete widget, I would expect all of the options supported here https://api.jqueryui.com/autocomplete/ to also apply on the Algolia autocomplete component, including delay

However when we set up our widget with the config above, the delay: 400 is ignored, and requests are sent to the server immediately on key stroke. Wondering if this is expected behaviour, or something we can easily control to minimise unnecessary network usage?

I would expect it to work more like the following: https://www.plus2net.com/jquery/msg-demo/autocomplete-delay.php

moloughlin avatar Jun 20 '19 07:06 moloughlin

jquery is one thing, jqueryui is another.

You want to set debounce 400 on your dataset object. Like sources[0].debounce = 400

stevenbg avatar Aug 02 '19 11:08 stevenbg

Autocomplete v0 has been in low maintenance mode for a few years and we just released Autocomplete v1 so I'm closing this.

Resources

francoischalifour avatar May 04 '21 10:05 francoischalifour