Bug Tracker

Modify

Ticket #6231 (closed bug: wontfix)

Opened 3 years ago

Last modified 3 years ago

: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:
Blocking: Blocked by:

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.

Change History

comment:1 Changed 3 years ago by addyosmani

  • Priority set to undecided
  • Status changed from new to closed
  • Resolution set to wontfix

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.

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.