Bug Tracker

Ticket #4538 (closed bug: invalid)

Opened 5 years ago

Last modified 4 years ago

pushStack generates wrong selector properties, if you use multiple selectors

Reported by: trixi Owned by:
Priority: minor Milestone:
Component: core Version: 1.3.2
Keywords: Cc:
Blocking: Blocked by:

Description

If you use a multiple Selector like $('.context-1, .context-2').find('a'). The pushStack method creates the following selector-property: '.context-1, .context-2 a'. I have added a patch, wich adds support for the traversing methods: find, children, next and siblings.

Attachments

pushstack-selector.patch Download (2.3 KB) - added by trixi 5 years ago.

Change History

Changed 5 years ago by trixi

comment:3 follow-up: ↓ 5 Changed 4 years ago by dmethvin

  • Keywords needsreview added
  • Status changed from new to closed
  • Resolution set to invalid
  • Milestone 1.4 deleted

The .selector property isn't publicly documented. It's used for .live but that is not supported in combination with filtering methods such as .find(). It is not our intention to provide a documented and always-accurate .selector property. Do not use the .selector property for any external needs. It may be changed in the future. The first rule of the .selector property is that you don't talk about the selector property.

comment:4 Changed 4 years ago by dmethvin

  • Keywords needsreview removed

comment:5 in reply to: ↑ 3 Changed 4 years ago by jitter

Replying to dmethvin:

The .selector property isn't publicly documented.

Ummm... the property is documented publicly  http://api.jquery.com/selector/ but it also has a warning

[...] if DOM traversal methods have been called on the object, the string may not be a valid jQuery selector expression.

Note: See TracTickets for help on using tickets.