Wrapped createTag method to flag is creation is in progress, and watch for this in the blur event #147

Open
wants to merge 2 commits into
from

Conversation

Projects
None yet
3 participants
@robertprice

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.

robertprice added some commits Feb 11, 2013

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
@robertprice

This comment has been minimized.

Show comment
Hide comment
@robertprice

robertprice Feb 11, 2013

Owner

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.

Owner

robertprice commented on cbd1adb Feb 11, 2013

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.

@ghost ghost assigned aehlke Mar 5, 2013

@jrwdunham

This comment has been minimized.

Show comment
Hide comment
@jrwdunham

jrwdunham Aug 5, 2015

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...

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...

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