jQuery: The Write Less, Do More JavaScript Library

Ticket #2266 (closed bug: invalid)

Opened 7 months ago

Last modified 3 months ago

multiFilter doesn't properly filter with selectors that contain descendants

Reported by: scott.gonzalez Assigned to: anonymous
Type: bug Priority: major
Milestone: 1.2.4 Component: core
Version: 1.2.2 Keywords: is filter multiFilter
Cc: Needs: Review

Description

There seems to be a problem with multiFilter when filtering with descendant selectors. There may be other selectors that cause this problem as well, but I have only noticed it with descendant (space) and child (>) selectors.

The following code will return a jQuery object with the body element (expected: empty jQuery object):

$('body').filter('html>head');
// or
$('body').filter('html head');

Similarly, the following will return true (expected: false):

$('body').is('html>head');

Attachments

Change History

Changed 3 months ago by flesler

  • status changed from new to closed
  • resolution set to invalid

$.filter and $.fn.is accept only simple selectors, that means, no descendance. Check the docs to learn more about simple selectors.

Changed 3 months ago by flesler

  • milestone changed from 1.2.3 to 1.2.4
Note: See TracTickets for help on using tickets.