Bug Tracker

Modify

Ticket #6279 (closed bug: duplicate)

Opened 3 years ago

Last modified 2 years ago

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:
Blocking: Blocked by:

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

next-adjacent.htm Download (1.4 KB) - added by roydukkey 3 years ago.
Next Adjacent Selector Fails IE6 and IE7

Change History

Changed 3 years ago by roydukkey

Next Adjacent Selector Fails IE6 and IE7

comment:1 Changed 3 years ago by roydukkey

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 3 years ago by dmethvin

  • Component changed from unfiled to selector

comment:3 Changed 3 years ago by snover

  • Milestone 1.4.3 deleted

Resetting milestone to future.

comment:4 Changed 3 years ago by snover

  • Priority set to high
  • Status changed from new to open

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

comment:5 Changed 2 years ago by danheberden

  • Milestone set to 1.next

Still present in ie6 and ie7 in 1.5.2pre

comment:6 Changed 2 years ago by danheberden

  • Keywords ie6 ie7 added; IE6 removed

comment:7 Changed 2 years ago by timmywil

  • Status changed from open to closed
  • Resolution set to duplicate

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

comment:8 Changed 2 years ago by timmywil

Duplicate of #7528.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.