I have wrapped the createTag method so it flags if creation of a tag is in place, and when create the flag is removed. I look for this tag in the blur event and don't try to create the tag again if the flag is set.
This fixes a bug I had in Firefox where I was using a confirm() dialog in a beforeTagAdded event handler. Calling confirm() in firefox causes the field to loose focus triggering the blur event. This meant it called createTag twice for a tag in this situation. Adding the flag when creating a tag, and checking for it in the blur event handler catches this condition.
wrapped the createTag method to flag if a tag is in the process of be…
…ing created, we also check for this in the blur event to make sure we don't doubley create the tag
Wrapped the createTag method so it flags if it is in the process of creating a tag already. I then check for this in the blur() event handler so if a tag is already in the process of being created it won't try to create again.
This fixes an issue I had using a confirm() dialog in a beforeTagAdded event handler. I was using confirm to get the user to confirm if the tag really should be added. On Firefox, calling confirm triggers causes the field to loose focus and triggers a blur event and caused it to try to add the tag twice.
I was having the same issue: using a jQuery dialog widget to confirm creation of a new tag and that causing a blur event which was resulting in duplicate tags. I used robertprice's changes and they seem to be fixing the problem...