mirror of
https://github.com/wahyd4/jQuery-Tags-Input.git
synced 2026-08-09 04:46:44 +10:00
Fix bug : now, when you delete the last character of a new tag, the previous tag is not removed.
This commit is contained in:
+2
-1
@@ -222,10 +222,11 @@
|
||||
}
|
||||
});
|
||||
//Delete last tag on backspace
|
||||
data.removeWithBackspace && $(data.fake_input).bind('keyup', function(event)
|
||||
data.removeWithBackspace && $(data.fake_input).bind('keydown', function(event)
|
||||
{
|
||||
if(event.keyCode == 8 && $(this).val() == '')
|
||||
{
|
||||
event.preventDefault();
|
||||
var last_tag = $(this).closest('.tagsinput').find('.tag:last').text();
|
||||
var id = $(this).attr('id').replace(/_tag$/, '');
|
||||
last_tag = last_tag.replace(/[\s]+x$/, '');
|
||||
|
||||
Reference in New Issue
Block a user