Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty() not working correctly in some cases #222

Open
Noamyoungerm opened this issue Aug 30, 2014 · 0 comments
Open

Empty() not working correctly in some cases #222

Noamyoungerm opened this issue Aug 30, 2014 · 0 comments

Comments

@Noamyoungerm
Copy link

I don't really have a MWE, but in my case, values in the textbox that have not been added to a tag are pushed to a tag on form submit. This correctly adds the tags to the submitted form, but afterwards calling .tagsmanager('empty') fails to empty the programatically pushed values.

Workaround, but not a proper solution to the cause of the issue:

empty : function() {
        var $self = $(this), tlis = $self.data("tlis"), tlid = $self.data("tlid"), tagId;

         while (tlid.length > 0) {
            .... //Clear out the visible and physical tags
        }

        $self.data('tlis', []) //Here we actually enforce the method contract and empty all the tags
        privateMethods.refreshHiddenTagList.call($self); //Not entirely sure this line is needed

        $self.trigger('tm:emptied', null);
        privateMethods.showOrHide.call($self);
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant