Bug Tracker

Modify

Ticket #7063 (closed bug: invalid)

Opened 4 years ago

Last modified 4 years ago

Bug with :not and :last

Reported by: hobbestigrou Owned by:
Priority: Milestone: 1.4.3
Component: selector Version: 1.4.2
Keywords: selector, :last, :not, :first Cc:
Blocking: Blocked by:

Description

Hi,

I'm using the latest version of jQuery 1.4.2.

I have a problem with :not and :last I think. For exemple when I try with this syntax: $('.reverse:visible:last:not(:first)');

and this match anything, but if I use this syntax: $('.reverse:visible:not(:first):last');

This matches one element, so this is ok.

I've tried with chromium 6.0.4 and Firefox 3 and 4.

Change History

comment:1 Changed 4 years ago by snover

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

This is not a bug.

The first selector finds the last .reverse, then removes it if it is the first of the filtered elements. Since it is always the first, it will always be filtered away.

The second selector finds all .reverse that are not the first, and then picks the last one of those.

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.