Timtech4u / gwtquery

Automatically exported from code.google.com/p/gwtquery
MIT License
0 stars 0 forks source link

removeAttr() doesn't remove attribute #165

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
<a href="#" title="a title">anchor</a>

$("a").removeAttr("title");

We expect that the anchor doesn't have title attribute anymore. But the title 
is just set to an empty value. The side effect is that IE displays a native 
tooltip with the string null as content.

Original issue reported on code.google.com by julien.d...@gmail.com on 17 Dec 2012 at 11:26

GoogleCodeExporter commented 9 years ago
This seems to be a problem with GWT itself. It works fine in Chrome, but in 
Firefox, i tried calling GWT's Element object's removeAttribute because that is 
what is finally called. The results were the same. 

Anyways, the gwtQuery's code is removing attribute first and then checking on 
whether it is a boolean or not(as done in JQuery code). Seems a bit redundent. 
Changed that (as it is done in Jquery)...(see patch)

Original comment by kisalay...@gmail.com on 16 Jan 2013 at 1:33

Attachments:

GoogleCodeExporter commented 9 years ago
Hi kisalaya89,

Thanks for the patch. Can I kindly ask you to submit a pull request on the 
project on github ? : https://github.com/gwtquery/gwtquery

That make the code review and merge mechanism easier.

Original comment by julien.d...@gmail.com on 16 Jan 2013 at 1:57

GoogleCodeExporter commented 9 years ago
Although the patch fixes this issue, it breaks other cases like    
gq.removeAttr("class") which is in the test suite.

I think the correct fix is moving the e.removeAttribute(key) from the line #173 
to #181

Original comment by manuel.carrasco.m on 7 Feb 2013 at 2:48

GoogleCodeExporter commented 9 years ago
Hi manuel.carrasco.m,

This is the updated patch. It is according to what you said in above comment, 
and it works.

Original comment by kisalay...@gmail.com on 7 Feb 2013 at 3:16

Attachments:

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 6c36a6ef2221.

Original comment by manuel.carrasco.m on 11 Feb 2013 at 1:52