mirror of
https://github.com/jquery/jquery.git
synced 2026-02-06 15:45:14 -05:00
Return correct index for no-arg index() calls. Fixes #10977. Closes gh-971
This commit is contained in:
@@ -112,7 +112,7 @@ jQuery.fn.extend({
|
||||
|
||||
// No argument, return index in parent
|
||||
if ( !elem ) {
|
||||
return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1;
|
||||
return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1;
|
||||
}
|
||||
|
||||
// index in selector
|
||||
|
||||
Reference in New Issue
Block a user