hernantz / doubleSuggest

Facebook like jquery search suggestion plugin that searches in local and remote data sources.
65 stars 7 forks source link

=< IE8 doesn't take you to a path on enter keypress #5

Open JohnMcLear opened 12 years ago

JohnMcLear commented 12 years ago

To replicate:

Open IE8 Visit http://myschoolholidays.com Search for a school IE "sandy" Press down until you get to it with your cursor Hit enter

Nothing happens, works fine in IE9 and other browsers

hernantz commented 12 years ago

Hi johnyma22, i tried to replicate your error on a native IE8 and IE9 with IE8 compatibility mode and worked fine. I did see that the search input is not centered correctly (css issue), and got an error on something like cloudflare.js, but did not affect the correct behaviour of doubleSuggest.

Tell me if you get more details on it.

JohnMcLear commented 12 years ago

Can you provide details on the cloudflare error please?

hernantz reply@reply.github.com wrote:

Hi johnyma22, i tried to replicate your error on a native IE8 and IE9 with IE8 compatibility mode and worked fine. I did see that the search input is not centered correctly (css issue), and got an error on something like cloudflare.js, but did not affect the correct behaviour of doubleSuggest.

Tell me if you get more details on it.


Reply to this email directly or view it on GitHub: https://github.com/hernantz/doubleSuggest/issues/5#issuecomment-4900908 This email and its attachments may be confidential and are intended solely for the use of the individual to whom it is addressed. Any views or opinions expressed are solely those of the author and do not necessarily represent those of the organisation from which this email originated. If you are not the intended recipient of this email and its attachments, you must take no action based upon them, nor must you copy or show them to anyone. Please contact the sender if you believe you have received this email in error. This email was sent by School Email - Safe Webmail and Hosted Email for Schools

hernantz commented 12 years ago

Mmm it was weird, when I first entered the site I got an error on cloudflare.min.js, line 29, character 454. Take into account that this ie8 browser is quite old, and was never updated. But doubleSuggest did work and redirects when clicking on a result or hitting enter....

JohnMcLear commented 12 years ago

I can replicate this bug consistently.

Visit the website in IE8 -- http://myschoolholidays.com, type "Wilsden" in the search box, press the down key, press enter.

Nothing happens

hernantz commented 12 years ago

Are you using any ie testing tool like IEtester?

JohnMcLear commented 12 years ago

Yea, but I also noticed that search in general on enter doesn't work..

For example..

Visit http://myschoolholidays.com in any browser

Type in Wilsden

Hit enter

This should do a site search and take you to: http://myschoolholidays.com/search.php?q=wilsden

Is this possible? :)

Cheers!

-----Original Message----- From: hernantz [mailto:reply@reply.github.com] Sent: 09 April 2012 13:31 To: John McLear Subject: Re: [doubleSuggest] =< IE8 doesn't take you to a path on enter keypress (#5)

Are you using any ie testing tool like IEtester?


Reply to this email directly or view it on GitHub: https://github.com/hernantz/doubleSuggest/issues/5#issuecomment-5024401 This email and its attachments may be confidential and are intended solely for the use of the individual to whom it is addressed. Any views or opinions expressed are solely those of the author and do not necessarily represent those of the organisation from which this email originated. If you are not the intended recipient of this email and its attachments, you must take no action based upon them, nor must you copy or show them to anyone. Please contact the sender if you believe you have received this email in error. This email was sent by School Email - Safe Webmail and Hosted Email for Schools

JohnMcLear commented 12 years ago

I hacked together a solution.. It's hacky but you will get the idea...

  var isFocusOnSearch = true;
  $('#fb').focus(function(){
    isFocusOnSearch = true;
  });
  $('#fb').keypress(function(e){
    if(e.keyCode == 13 && isFocusOnSearch){ // If enter has been pressed and the focus is on the input box not a result
      var searchValue = $('#fb').val();
      window.location = "/search.php?q="+searchValue;
    }
  });

  $('#fb').doubleSuggest({...
    ....
    beforeRetrieve: function(queryString){
      isFocusOnSearch = true;
      return queryString;
    },
    onResultFocus: function(){
      isFocusOnSearch = false;
    }
  });

hernantz commented 12 years ago

Oh! I got what you meant. I thought you where talking about selecting an element by pressing enter. The doubleSuggest text input is just another input from a form. Press enter without hovering the search result's list and you should get the submit alert Take a look here: http://jsfiddle.net/pkdPc/1/

Edit: if that does not work try adding a submit input like this

<form action="/somewhere.php" method="get">
<input type="text" id="myDoubleSuggestInput" name="search" />
<input type="submit" style="display:none;">
</form>