Opened January 14, 2009 05:46PM UTC
Closed January 17, 2009 06:52PM UTC
Child selector in the attached file has a very strange (and buggy) behaviour, it's broken by markup which shouldn't interfere.
Broken in: FF3, IE6/7, Opera 9
Works in: Safari 3, Opera 10
jQuery 1.2.6 was fine
Should alert("Yay, it works"); alerts, "WHY AM I SELECTED?"
New test - broken
New test - works
It works for me, in both cases the expected element is selected. But the coloring is a bit misleading.
Sorry, I was in a hurry and I uploaded the wrong files. I just reuploaded them.
My issue is that the selector (.m2>li>b) should add the red background only on the first "test" (B tag) and not on all three Bs inside.
The strange thing is that this behaviour is triggered by a B outside the first ul that should be checked (the one with class m2). Without that all goes fine.
I re-uploded the files without the styles, sorry for thet, it was a mistake.
Still working fine. Try this: jQuery('.m2>li>b') in Firebug!
Sorry, rather this: jQuery('.m2>li>b')
hmmm... for me it's wrong, it selects 3 elements instead of 1
Oh, sorry, I was testing with an earlier build, you're right!
This issue has appeared in 1.3rc1, b2 was fine.
i also have this problem using
$('div.editable > div').css('border','green 1px solid');
all divs on the page are given a green border, whereas
$('.editable > div').css('border','green 1px solid');
Added my own test case, which I am guessing is the same bug (or at least closely related)
Thanks for the test cases, everyone. It was a rather obscure bug, but I just fixed it:
Will be merging in to jQuery shortly.