Skip to main content

Bug Tracker

Side navigation

#3279 closed bug (invalid)

Opened August 21, 2008 11:35PM UTC

Closed October 12, 2009 11:56PM UTC

Last modified February 14, 2011 08:32AM UTC

[autocomplete] trimWords splits on multipleSeparator regardless of options.multiple setting

Reported by: SDraconis Owned by:
Priority: minor Milestone: 1.3
Component: plugin Version: 1.2.6
Keywords: Cc:
Blocked by: Blocking:
Description

This is for Jörn Zaefferer's AutoComplete plugin (http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/).

The trimWords function will always split the value on options.multipleSeparator, even if options.multiple == false. The fix is to change the line

var words = value.split( options.multipleSeparator );

to

var words = options.multiple ? value.split( options.multipleSeparator ) : value;
Attachments (0)
Change History (4)

Changed August 22, 2008 12:05AM UTC by SDraconis comment:1

Sorry, the line should be

var words = options.multiple ? value.split( options.multipleSeparator ) : [value];

Changed October 12, 2009 11:56PM UTC by dmethvin comment:2

resolution: → invalid
status: newclosed

This is not a jQuery core bug. Please report plugin bugs to the plugin's author, or ask on the jQuery forums. jQuery UI bugs should be reported on the UI bug tracker, http://dev.jqueryui.com .

Changed February 14, 2011 08:21AM UTC by anonymous comment:3

Changed February 14, 2011 08:32AM UTC by anjumasim comment:4

_comment0: function selectCurrent() { \ var selected = select.selected(); \ if (!selected) \ return false; \ \ var v = selected.result; \ \ v = v.split(":")[1]; \ previousValue = v; \ \ \ \ if (options.multiple) { \ var words = trimWords($input.val()); \ if (words.length > 1) { \ //v = words.slice(0, words.length - 1).join(options.multipleSeparator) + options.multipleSeparator + v; \ v = $input.val().slice(0, $input.val().length - words[words.length - 1].length) + v; \ } \ \ v += options.multipleSeparator; \ } \ \ \ \ $input.val(v); \ hideResultsNow(); \ $input.trigger("result", [selected.data, selected.value]); \ return true; \ }1297672418250329