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

Use .is('tr') instead of .attr('tagName') == 'TR' to determine table rows correctly. #40

Closed
elo80ka opened this issue Feb 27, 2014 · 7 comments

Comments

@elo80ka
Copy link
Owner

elo80ka commented Feb 27, 2014

From andreas....@gmail.com on November 15, 2011 21:31:41

Using the tagName approach does not work in Google Chrome with the jQuery 1.6.x. is() is generally more reliable and the patch is really small and should not introduce any regressions.

Attachment: django-dynamic-formset.patch

Original issue: http://code.google.com/p/django-dynamic-formset/issues/detail?id=40

@elo80ka elo80ka self-assigned this Feb 27, 2014
@elo80ka
Copy link
Owner Author

elo80ka commented Feb 27, 2014

From stan.madueke on November 15, 2011 22:39:57

Status: Accepted
Owner: stan.madueke

@elo80ka
Copy link
Owner Author

elo80ka commented Feb 27, 2014

From systempa...@gmail.com on December 22, 2011 03:58:51

I'm using Firefox and I still cannot get this condition to pickup correctly.

The documentation for jQuery states that ".attr() should not be used on arrays", however this appears to be precisely what is happening at this part of the code. I originally thought that I'd done something wrong in the initialisation, but I've been playing with it for the past 2 hours without success.

Changing to ".is('tr')" suffers from the same problem.

@elo80ka
Copy link
Owner Author

elo80ka commented Feb 27, 2014

From systempa...@gmail.com on December 22, 2011 04:51:40

Sorry my fault, $$.is('TR') does work in this case after all.

@elo80ka
Copy link
Owner Author

elo80ka commented Feb 27, 2014

From iak...@gmail.com on March 27, 2012 23:47:07

As per http://bugs.jquery.com/ticket/9228#comment:3 , tagName cannot be fetched using the attr function as it is a property not an attribute.

Use $$.prop('tagName') instead of $$.attr('tagName').

@elo80ka
Copy link
Owner Author

elo80ka commented Feb 27, 2014

From stan.madueke on March 27, 2012 23:53:24

@iakbar: thanks for the link. I think $$.is(...) is the right way to do this though.

@elo80ka
Copy link
Owner Author

elo80ka commented Feb 27, 2014

From g...@warnes.net on February 21, 2014 14:41:39

I've made the change in my copy of the code to use $$.prop('tagName') and it is working happily now.

@elo80ka
Copy link
Owner Author

elo80ka commented Aug 10, 2014

Fixed in 1d57afe.

@elo80ka elo80ka closed this as completed Aug 10, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant