Jump to content

[SOLVED] BLock SEARCH - Pressing Enter


Recommended Posts

Hi,

How to do it so it was as in e.g. http://www.google.com/ when I type something I can see appearing possible matches, but when I press enter only what I wrote is send, NOT THE FIRST MATCH (as it is in prestashop). How to change it?

Thank you in advance :)


It is what you typed is sent. Visit demo, click in search box and start typing in "shu", briefly pause and let the suggestions appearer, ignore and press enter. Results for shu will be displayed. When typing do not touch your mouse or any down key, causing one of the suggestions to be selected/highlighted (dark background) as in third image attached

28972_TxkU1PKpZW7s64VsL3e1_t

28973_9jzlBkSRz62gUQxXnfER_t

28974_fjxPw7ENygYJzFfyQKXq_t

Link to comment
Share on other sites

I overwrote all java (js/jquery/) files and still it is the same. Do you have any idea why?

Here's the link:
http://sklep.komtek.pl


It is not a bug but setting in JQuery. Find the file http://sklep.komtek.pl/js/jquery/jquery.autocomplete.js

Find the section at the beginning:

$.fn.extend({
   autocomplete: function(urlOrData, options) {
       var isUrl = typeof urlOrData == "string";
       options = $.extend({}, $.Autocompleter.defaults, {
           url: isUrl ? urlOrData : null,
           data: isUrl ? null : urlOrData,
           delay: isUrl ? $.Autocompleter.defaults.delay : 10,
           max: options && !options.scroll ? 10 : 150
       }, options);



replace it with

$.fn.extend({
   autocomplete: function(urlOrData, options) {
       var isUrl = typeof urlOrData == "string";
       options = $.extend({}, $.Autocompleter.defaults, {
           url: isUrl ? urlOrData : null,
           data: isUrl ? null : urlOrData,
           delay: isUrl ? $.Autocompleter.defaults.delay : 10,
           max: options && !options.scroll ? 10 : 150,
           selectFirst: false
       }, options);



There are two changes: adding a comma to the end of line starting max:... and inserting the line selectFirst: false

More info about autocomplete options are here

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...