Skip to main content

Bug Tracker

Side navigation

#8906 closed bug (fixed)

Opened April 18, 2011 05:39PM UTC

Closed July 12, 2012 01:52AM UTC

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

Reported by: anonymous Owned by:
Priority: high Milestone: 1.8
Component: selector Version: 1.5.2
Keywords: Cc:
Blocked by: Blocking:
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>
Attachments (0)
Change History (5)

Changed April 18, 2011 05:47PM UTC by colinbashbash <colin.cole@subzero.com> comment:1

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

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

Changed April 21, 2011 04:13PM UTC by rwaldron comment:2

component: unfiledtraversing
priority: undecidedhigh

Changed April 21, 2011 04:49PM UTC by timmywil comment:3

status: newopen

Changed July 12, 2011 04:30PM UTC by john comment:4

Confirmed in bug triage.

Changed July 12, 2012 01:52AM UTC by dmethvin comment:5

component: traversingselector
milestone: 1.next1.8
resolution: → fixed
status: openclosed