Skip to content
This repository has been archived by the owner on Aug 15, 2019. It is now read-only.

Uncaught TypeError: Cannot use 'in' operator to search for '0' in , #253

Closed
esbanarango opened this issue May 29, 2015 · 9 comments
Closed

Comments

@esbanarango
Copy link

Hello and Thank you for this project!

I'm using jQuery-Tags-Input with jQuery 2.1.3 and I'm getting this error when hitting ,:

Uncaught TypeError: Cannot use 'in' operator to search for '0' in ,

It references this:

//Line 367
$.each(event.data.delimiter ,function(index, value){
    if(event.which == value.charCodeAt(0)){
        flag = true;
    }
});
@lucknerjb
Copy link
Contributor

Duplicate of #223. I'm starting to think that this may have to do with the version of jquery and not the change that we implemented. Let me give this a shot with 2.1.x and see what happens

esbanarango added a commit to esbanarango/jQuery-Tags-Input that referenced this issue May 29, 2015
@esbanarango esbanarango mentioned this issue May 29, 2015
@lucknerjb
Copy link
Contributor

I see your PR, but when trying it out with 2.1.3, I don't get any errors. Can you confirm that's the version that you are using?

@esbanarango
Copy link
Author

mmmm just double checked. jQuery JavaScript Library v2.1.3

@lucknerjb
Copy link
Contributor

Can you create a jsfiddle replicating the issue so I can play around with it? I'd like to find out why you're seeing this issue and I am not... it's weird

@esbanarango
Copy link
Author

@lucknerjb Sure!

@lucknerjb
Copy link
Contributor

ah! actually, I managed to replicate it. I just realized I was working in an older local branch which was using

for (delimiter in event.data.delimiter)

instead of

$.each(event.data.delimiter)

@lucknerjb
Copy link
Contributor

I'll close your PR and push a change that should cover the scenario where folks have manually set their delimiters to be a string when the initialize the plugin as your change would break that.

Thanks for helping clear this issue though!

@esbanarango
Copy link
Author

@lucknerjb Thank you!!

lucknerjb added a commit that referenced this issue May 29, 2015
@lucknerjb
Copy link
Contributor

No prob at all :-)

esbanarango added a commit to esbanarango/jQuery-Tags-Input that referenced this issue May 31, 2015
This reverts commit 8e46788.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants