Solved

Jquery stop auto compleate after list scrolls

Posted on 2014-02-24
3
397 Views
Last Modified: 2014-04-04
Hello. I have a jQuery script that auto fills a text box based on an array in a variable.
It seems to work until you have to scroll and select a state that is down below Iowa.
Try to select Texas or a state in that are of the list.
Here is my Forked jsFiddler URL: http://jsfiddle.net/kz2yg/
0
Comment
Question by:semfreak
  • 2
3 Comments
 
LVL 11

Accepted Solution

by:
Murfur earned 500 total points
ID: 39883190
Try a different browser to confirm but are you using Firefox by any chance? And do you have the Firebug extension installed? I ask because have found recently that jQuery functionality goes more than a little nuts if Firebug is installed and you end up chasing ghosts.

I don't see the problem in Safari or Chrome at all, and Firefox does work if I start with Firebug disabled otherwise I see these errors in the Firebug console:

jquery-ui.js (line 146)
TypeError: $.curCSS is not a function
size -= parseFloat( $.curCSS( elem, "padding" + this, true) ) || 0;

jquery-2.1.0.js (line 1429)
Error: Syntax error, unrecognized expression: unsupported pseudo: textEquals
throw new Error( "Syntax error, unrecognized expression: " + msg );
0
 
LVL 54

Expert Comment

by:Julian Hansen
ID: 39883226
Take your focus: function out.

After you select an item the mouse is hovering over the list for a brief time and the focus is picking up the item that is in that mouse position when the list is at the beginning.

If you click say Utah on the extreme left edge of the lable and immediately move your mouse left you should be able to get Utah to stick.

Remove the focus: function and the problem goes away.
0
 
LVL 54

Expert Comment

by:Julian Hansen
ID: 39883250
Actually just remove the  following line from focus

$(this).blur();

Open in new window

0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

PROBLEM: The other day I was working on adding an ajax request to a webpage that already had a dialog box on the page.  The dialog box was using relative positioning to be positioned next to a form field I had on the page.  Everything was working…
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question