Bug Tracker

Ticket #7894 (closed bug: wontfix)

Opened 4 years ago

Last modified 4 years ago

Selector option:gt(-1) doesn't work

Reported by: g_gus Owned by:
Priority: undecided Milestone: 1.6
Component: unfiled Version: 1.4.4
Keywords: Cc:
Blocking: Blocked by:

Description

very similar to #5550 but with a use case that's imho not invalid:

In writing a pagination function it would be useful to have the :gt behave consistently, accepting -1 as a possible value.

Here's a simple use case:  http://jsfiddle.net/GMJZ5/1/

Thanks.

Change History

comment:1 Changed 4 years ago by danheberden

Better yet, you could get rid of the custom selectors completely.  http://jsfiddle.net/danheberden/yxQgd/

Thanks for taking the time to write out a bug report / feature request. In the case of :gt, gt(-1) seems odd to me. gt(-1) is simply less than something else. That is, :gt(-1):lt(5) is simply lt(5). Plus, there is no -1 index to be greater than. I know if makes sense that index 0 is greater than anything, but -1 doesn't exist.

Custom selectors aren't great in any respect, as the above example I pasted doesn't even have to use sizzle. Faster and cleaner; the gains are two fold.

Version 1, edited 4 years ago by danheberden (previous) (next) (diff)

comment:2 Changed 4 years ago by danheberden

  • Status changed from new to closed
  • Resolution set to wontfix
Note: See TracTickets for help on using tickets.