#6279 closed bug (duplicate)
next adjacent selector and/or child selector in IE6
Reported by: | Timmy Willison | Owned by: | |
---|---|---|---|
Priority: | high | Milestone: | 1.next |
Component: | selector | Version: | 1.4.2 |
Keywords: | next adjacent selector ie6 ie7 | Cc: | |
Blocked by: | Blocking: |
Description
I'm sorry I can't provide a test case. I need to leave the fixed version on our dev sites. But I can change the code back and forth. I'm sure it would be easy to create a test case. You can tell what the structure of my DOM is from the following code (glass-top is a select element, breed is an input element elsewhere on the page, and everything below is contained inside a div). Like so:
Markup: <div>
<select id="glass-top"/> <input/> <span/> <ul>
<li/>
</ul>
</div>
Original JS (works in all browsers except IE6): showHideBreed : function() {
$('#breed').hide(); $('#glass-top + input + span + ul > li').click(function() {
if($(this).attr('value') == 410) {
$('#breed').show();
} else {
$('#breed').hide();
}
});
}
Working JS: showHideBreed : function() {
$('#breed').hide(); $('#glass-top').next().next().next('ul').find('li').click(function() {
if($(this).attr('value') == 410) {
$('#breed').show();
} else {
$('#breed').hide();
}
});
}
I just thought you should know. It's possible that using the '+' selector multiple times in a row is causing problems in IE6? I'm not sure. I don't think the '>' child selector is the culprit because I tried replacing just that with find('li') and got the same result. I haven't looked at the jQuery source yet, but I thought I should go ahead and make the ticket.
Thanks guys, Timmy
Attachments (1)
Change History (9)
Changed 13 years ago by
Attachment: | next-adjacent.htm added |
---|
comment:1 Changed 13 years ago by
I too have found this bug and can add some useful information. Attached is a test case.
It seems that in $("#btnAPI + ul li a") the next adjacent selector is failing in ie6 and ie7. However, if you try to select the element via the next() and find() functions, all is well. ie. $("#btnAPI").next("ul").find("li a").
The next adjacent selection was working in version 1.3.2.
comment:2 Changed 13 years ago by
Component: | unfiled → selector |
---|
comment:4 Changed 12 years ago by
Priority: | → high |
---|---|
Status: | new → open |
test case also problematic in ie7, so a problem with Sizzle.
comment:6 Changed 12 years ago by
Keywords: | ie6 ie7 added; IE6 removed |
---|
comment:7 Changed 12 years ago by
Resolution: | → duplicate |
---|---|
Status: | open → closed |
Closing in favor of ticket assigned to John. Good-bye my first ticket! Nobody look at how I pasted code in ticket...
Next Adjacent Selector Fails IE6 and IE7