Skip to main content

Bug Tracker

Side navigation

#6681 closed bug (invalid)

Opened June 16, 2010 04:46PM UTC

Closed June 18, 2010 01:02AM UTC

jquery.autocomplete returns first possible match w/ string '0'

Reported by: alwhiting Owned by:
Priority: Milestone: 1.4.3
Component: unfiled Version: 1.4.2
Keywords: autocomplete matches on 0 Cc:
Blocked by: Blocking:
Description

Using jquery.autocomplete plugin if you 'autocomplete' on a value of '0' the first element from the data-cache array is returned even if that element does not contain a '0'.

This seems to be happening in the 'loadFromCache' function:

if (cache.data[q]) return cache.data[q];

If q is 0 it appears to be returning the first element of cache.data.

The following change fixes this, however I am not sure if it is the best solution:

if (q != 0 && cache.data[q]) return cache.data[q];

Attachments (0)
Change History (1)

Changed June 18, 2010 01:02AM UTC by dmethvin comment:1

resolution: → invalid
status: newclosed

Please ask for plugin help on the forum; this is the jQuery core bug tracker.