[BUG] First added item will never be deleted

0plus1's Avatar

0plus1

21 Jun, 2011 02:52 PM

I was copying the values that the plugins add in the hidden input to another input before saving and I noticed that the first item added will never be deleted.

The reason is this:

Line 338:
values_input.val(values_input.val().replace(","+data[opts.selectedValuesProp]+",",","));

replace searches for: ,thevalue,
while the first item will always be thevalue,

I don't really understand the reason behind this (why is being replaced with a , instead of an empty space?), anyway this is an easy fix:

values_input.val(values_input.val().replace(data[opts.selectedValuesProp]+"," , ""));

  1. 1 Posted by Max on 23 Jun, 2011 11:03 AM

    Max's Avatar

    I also noticed this and have fixed. See this thread: https://drew.tenderapp.com/discussions/autosuggest/219-added-featur...

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac