Bug Tracker

Opened 13 years ago

Closed 13 years ago

#6681 closed bug (invalid)

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:


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];

Change History (1)

comment:1 Changed 13 years ago by dmethvin

Resolution: invalid
Status: newclosed

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

Note: See TracTickets for help on using tickets.