Bug Tracker

Modify

Ticket #2278 (closed bug)

Opened 6 years ago

Last modified 3 years ago

animate calculates the wrong height of element with implicit width

Reported by: andreasc Owned by: andreasc
Priority: low Milestone: 1.5
Component: effects Version: 1.2.2
Keywords: animate height Cc:
Blocking: Blocked by:

Description

Full description:  http://groups.google.com/group/jquery-dev/browse_thread/thread/f46d8dddfdf5eefc

Short description: When animating, for example sliding down an element (foo) inside an container (bar) with an explicit width, jquery doesnt take the width in to account when calculating the height of foo when its hidden. This could lead to jquery calculating the wrong height of foo if the width of bar makes text in foo linebreak like in the example in the full description url. It might sound vague but looking at the url above and the screenshots makes it a little more clear.

Suggested solution: When the position:absolute and visibillity: hidden is applied to the hidden element to determine its height an explicit width should be added calculated from its implicit width, once the correct height is determined, the explicit width can be removed.

As mentioned on the dev mailinglist Im not aware or sure about what kind of sideeffects a change like this could lead to, so i guess someone with good insight should say something about this first.

Change History

comment:1 Changed 6 years ago by brandon

  • Component changed from core to fx

comment:2 Changed 4 years ago by dmethvin

Hmmm, I think I have encountered this and didn't realize what caused it. From the linked post:

But what jquery forgets is that if the container of the element to animate has an explicit width it has to take that width into account. Or else this line breaks will not be taken in to account.

...

an explicit width should be added calculated from its implicit width

Right, but the implicit width would be based on the width of the parent. If the parent is also hidden, then this same process would need to be repeated up the tree until we reach an element that isn't hidden. This seems like it's going to be a mess...

comment:3 Changed 3 years ago by SlexAxton

  • Owner set to andreasc
  • Priority changed from major to low
  • Status changed from new to pending
  • Milestone changed from 1.2.3 to 1.5

Can we get any confirmation that this still exists as a bug, and perhaps a reduced test case? Thanks!

comment:4 Changed 3 years ago by trac-o-bot

  • Status changed from pending to closed

Automatically closed due to 14 days of inactivity.

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.