Bug Tracker

Modify

Ticket #6497 (closed enhancement: worksforme)

Opened 3 years ago

Last modified 3 years ago

.first() and .last() methods do not work if .children() returns only 1 child node.

Reported by: tubalmartin Owned by:
Priority: Milestone: 1.4.3
Component: traversing Version: 1.4.2
Keywords: children, first, last Cc: web@…
Blocking: Blocked by:

Description

If the method .children() returns just one child node .first() and .last() methods will not return the only child node its parent node has, instead they both will throw an error.

IMHO if just one child node is returned by .children(), both methods should return the only child node its parent has.

Excellent work by the way guys, jQuery rocks!!!

Attachments

test-6497.html Download (432 bytes) - added by dmethvin 3 years ago.

Change History

comment:1 Changed 3 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to worksforme

I tried to create a test case from your verbal description and it seems to work for me. It's *always* best to attach a test case and note which browsers you've tried.

Changed 3 years ago by dmethvin

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.