Skip to content
This repository has been archived by the owner on May 9, 2018. It is now read-only.

Bug: clicking in input and going to another page results in js error #61

Open
AAverin opened this issue Nov 16, 2012 · 3 comments · Fixed by #65
Open

Bug: clicking in input and going to another page results in js error #61

AAverin opened this issue Nov 16, 2012 · 3 comments · Fixed by #65

Comments

@AAverin
Copy link
Collaborator

AAverin commented Nov 16, 2012

If you click in any tagit input are then try to visit another page you get:
Uncaught Error: cannot call methods on autocomplete prior to initialization; attempted to call method 'close' jquery.min.js:2

Problem is that in input blur timer is set for 400ms, which then calls _addTag.
When we visit another page DOM changes autocomplete instance is removed, so attempt to all this.input.autocomplete('close').val(""); results in an error.

Solution would be to bind window.blur or hashchange and add clearTimeout and all 'destructor' routine of the plugin.
I will implement local workaround for now.

@AAverin
Copy link
Collaborator Author

AAverin commented Nov 16, 2012

nwm.
adding clearTimeout(self.timer) to destroy function solves the problem completely.
I'll commit the fix to my fork and maybe make another pull request, which probably wouldn't be merged for along time=)

@hailwood
Copy link
Owner

I'm hoping to get them merged this week. Just busy with paid work atm and I
like to review all changes before Imerge properly!
On Nov 16, 2012 7:19 PM, "AAverin" notifications@github.com wrote:

nwm.
adding clearTimeout(self.timer) to destroy function solves the problem
completely.
I'll commit the fix to my fork and maybe make another pull request, which
probably wouldn't be merged for along time=)


Reply to this email directly or view it on GitHubhttps://github.com//issues/61#issuecomment-10437788.

@AAverin
Copy link
Collaborator Author

AAverin commented Nov 16, 2012

Great, thanks.
I'm not sure how to edit pull request and add commits to them on github (new here), so I'll probably delete the current one and make a new with all fixes implemented.
Feel free to make any changes you may find appropriate to my code=)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants