Calling onTagAdded on a singlefield runs twice #40

Closed
thenitai opened this Issue Oct 6, 2011 · 2 comments

Comments

Projects
None yet
3 participants

thenitai commented Oct 6, 2011

Hi,

Doing a simple:

$("#mytags").tagit({
onTagAdded: function(event, tag) {
alert('bla';
// do something special
}
});

on a singlefield runs it twice.

I had the same problem. I fixed it by modifying tagit

        this._trigger('onTagAdded', null, tag);

        // Cleaning the input.
        this._tagInput.val('');

        // insert tag
        this._tagInput.parent().before(tag);

changes to:

        // Cleaning the input.
        this._tagInput.val('');

        // insert tag
        this._tagInput.parent().before(tag);
        this._trigger('onTagAdded', null, tag);

I am not exactly sure why, but after that, the issue dissapeared.

Owner

aehlke commented Nov 23, 2012

I'm not sure how @shadowdrak 's fix would help, but I've made a fix for extra events firing when your'e using autocomplete in 6999353

Let me know if this bug is still around and I'll re-open the issue. I haven't been able to repro now. Thanks.

aehlke closed this Nov 23, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment