Solved

Jquery stop auto compleate after list scrolls

Posted on 2014-02-24
3
394 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 51

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 51

Expert Comment

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

$(this).blur();

Open in new window

0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
The viewer will learn how to dynamically set the form action using jQuery.

706 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now