Skip to main content

Bug Tracker

Side navigation

#6279 closed bug (duplicate)

Opened March 13, 2010 01:14AM UTC

Closed April 17, 2011 07:32AM UTC

Last modified April 17, 2011 07:32AM UTC

next adjacent selector and/or child selector in IE6

Reported by: timmywil 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)
  • next-adjacent.htm (1.4 KB) - added by roydukkey March 17, 2010 01:19AM UTC.

    Next Adjacent Selector Fails IE6 and IE7

Change History (8)

Changed March 17, 2010 01:21AM UTC by roydukkey comment:1

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.

Changed June 15, 2010 12:54AM UTC by dmethvin comment:2

component: unfiledselector

Changed November 12, 2010 02:40AM UTC by snover comment:3

milestone: 1.4.3

Resetting milestone to future.

Changed November 19, 2010 10:22AM UTC by snover comment:4

priority: → high
status: newopen

test case also problematic in ie7, so a problem with Sizzle.

Changed March 31, 2011 12:43AM UTC by danheberden comment:5

milestone: → 1.next

Still present in ie6 and ie7 in 1.5.2pre

Changed March 31, 2011 12:44AM UTC by danheberden comment:6

keywords: next adjacent selector IE6next adjacent selector ie6 ie7

Changed April 17, 2011 07:32AM UTC by timmywil comment:7

resolution: → duplicate
status: openclosed

Closing in favor of ticket assigned to John. Good-bye my first ticket! Nobody look at how I pasted code in ticket...

Changed April 17, 2011 07:32AM UTC by timmywil comment:8

Duplicate of #7528.