Skip to main content

Bug Tracker

Side navigation

#6231 closed bug (wontfix)

Opened March 05, 2010 09:15AM UTC

Closed October 02, 2010 03:38PM UTC

:hidden does not work on tr

Reported by: raimund_meyer Owned by:
Priority: undecided Milestone: 1.4.3
Component: selector Version: 1.4.2
Keywords: Cc:
Blocked by: Blocking:
Description

It did work correctly in 1.3.2, but in 1.4.2 it always returns true.

I see in the the code that this is intentional, but why? At least a comment in the code would be helpful.

Attachments (0)
Change History (1)

Changed October 02, 2010 03:38PM UTC by addyosmani comment:1

priority: → undecided
resolution: → wontfix
status: newclosed

When using either the :hidden (or even the :visible) pseudo-seelctors, jQuery does a test on the actual 'visibility' of the element rather than its CSS visibility or display. What that means is that it checks if the element's physical height and width on the page are greater than 0.

Looking at the jQuery source, as you mentioned, we don't do this with <tr> elements. In this case jQuery checks the CSS display property and only considers the element hidden if its display property is set to none.

Elements which haven't been explicitly added to the DOM are always going to be considered hidden, even if the CSS related to them would allow them to be rendered as visible.

The official documentation (whilst not specifically covering <tr> elements) does include a summary of much of the above and is probably the best place to look for reference related to functions if the code itself hasn't included additional information in comments.