hailwood / jQuery-Tagit

The Jquery Tagit Plugin transforms an html unordered list into a unique tagging plugin.
264 stars 109 forks source link

Passed triggerKeys do not override defaults. #35

Closed scotthorn closed 12 years ago

scotthorn commented 12 years ago

When I use $('#my-ul').tagit({triggerKeys:['enter', 'tab']});

The resulting triggerKeys array in the tagit options looks like this: ['enter', 'tab', 'comma', 'tab']

Passed values only overwrite individual values in the array, so if fewer options are passed, the later indexes in the array remain. To get the behavior I desired (tags can include commas or spaces), I had to use: $('#my-ul').tagit({triggerKeys:['enter', 'tab', 'asdf', 'asdf']});

hailwood commented 12 years ago

Can you please make a jsfiddle or similar to duplicate this issue?

hailwood commented 12 years ago

Due to no response I am closing this issue.

scotthorn commented 12 years ago

Sorry for the delay. Here's a jsfiddle that shows the error:

http://jsfiddle.net/scotthorn/vA3YZ/1/