Bug Tracker

Modify

Ticket #3762 (closed bug: duplicate)

Opened 4 years ago

Last modified 4 years ago

multiple selectors inside :not() while using $.filter() do not work in 1.3b1

Reported by: garrett Owned by: john
Priority: major Milestone: 1.3
Component: selector Version:
Keywords: Cc:
Blocking: Blocked by:

Description

The following worked in jQuery 1.2.x:

$('ul>li').filter('li:not(.test-2,.test-4)').css({fontWeight: 'bold'});

It does not in jQuery 1.3b1. Curiously, it seems to work fine when used like so:

$('li:not(.test-3,.test-4)').css({backgroundColor: 'red'});

Also, the following statement works in 1.3b1 (which is similar to the first, except testing for one value inside of the :not()):

$('ul>li').filter('li:not(.test-2)').css({fontWeight: 'bold'});

So it seems that it may be an issue with passing multiple selectors in :not(), but only when filtering.

Attachments

jq1.3b1-filter-not.html Download (741 bytes) - added by garrett 4 years ago.
demonstration of the $.filter(':not(.test-1,.test-2)') bug

Change History

Changed 4 years ago by garrett

demonstration of the $.filter(':not(.test-1,.test-2)') bug

comment:1 Changed 4 years ago by garrett

This causes a JavaScript error in line 1812 of jQuery 1.3b1.

In this code (specifically the match[3]... line):

PSEUDO: function(match){

if ( match[1] === "not" ) {

match[3] = match[3].split(/\s*,\s*/);

}

return match;

},

comment:2 Changed 4 years ago by john

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

This is a duplicate of #3757, which has been resolved.

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.