Bug Tracker

Modify

Ticket #8906 (closed bug: fixed)

Opened 3 years ago

Last modified 21 months ago

.(prevAll('span:has(input,select,textarea)')

Reported by: anonymous Owned by:
Priority: high Milestone: 1.8
Component: selector Version: 1.5.2
Keywords: Cc:
Blocking: Blocked by:

Description

In this case, prevAll returns elements "in order of the DOM" instead of "in order of closest to element"

Example:

    <div> Works Correctly:
        <span>One</span>
        <span>Two</span>
        <span>Three</span>
        <a href="javascript:void(0)" onclick="alert($(this).prevAll('span').first().text());">test</a>
        <span>Five</span>
        <span>Six</span>
    </div>
    
    <div> Doesn't Work Correctly:
        <span><input />One</span>
        <span><input />Two</span>
        <span><input />Three</span>
        <a href="javascript:void(0)" onclick="alert($(this).prevAll('span:has(input,select,textarea)').first().text());">test</a>
        <span><input />Five</span>
        <span><input />Six</span>
    </div>

Change History

comment:1 Changed 3 years ago by colinbashbash <colin.cole@…>

i created ticket... having problems when setting author. hopefully it works this time.

Here's a JSFiddle:  http://jsfiddle.net/2Lrvy/

comment:2 Changed 3 years ago by rwaldron

  • Priority changed from undecided to high
  • Component changed from unfiled to traversing

comment:3 Changed 3 years ago by timmywil

  • Status changed from new to open

comment:4 Changed 3 years ago by john

Confirmed in bug triage.

comment:5 Changed 21 months ago by dmethvin

  • Status changed from open to closed
  • Resolution set to fixed
  • Component changed from traversing to selector
  • Milestone changed from 1.next to 1.8

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.