Bug Tracker

Opened 13 years ago

Closed 12 years ago

#5564 closed bug (invalid)

toggle() fails for elements with height=0

Reported by: jdrowell Owned by:
Priority: major Milestone: 1.4
Component: core Version: 1.3.2
Keywords: toggle, height Cc:
Blocked by: Blocking:


When a <div> (e.g.) contains only floated elements, it's height remains at 0, even though there is visible content "inside" it (semantically). jQuery seems to check for height=0 when it toggles items, 'cause they'll be shown but not hidden in this case. I vote for toggling the display property even when height=0.

Change History (1)

comment:1 Changed 12 years ago by addyosmani

need: ReviewTest Case
Resolution: invalid
Status: newclosed

Semantically speaking, although the <div> may contain elements that are present, unless an explicit height has been set in CSS for the <div> you wouldn't be able to see it nor any of the items (ie. they wouldn't be visible on screen).

Were we to not check for height being defined, we risk breaking standard CSS behavior by making toggle display content even when a height hasn't been defined.

In my opinion this is behavior which may be okay to define in a user/developer's own application but shouldn't be generalized to the core.

Please also remember to submit a working code example replicating the behavior you are submitting a bug fix or feature request for as this makes it easier for us to verify the behavior you're describing.

Note: See TracTickets for help on using tickets.