Opened 14 years ago

Closed 13 years ago

#4695 closed bug (fixed)

Accordion issue (and fix) with fillSpace:true

Reported by: Jörn Zaefferer Owned by:
Priority: major Milestone: 1.8.2
Component: ui.accordion Version: 1.7.2
Keywords: Cc:
Blocked by: Blocking:

Description (last modified by Jörn Zaefferer)

There is a logical bug in accordion's .resize() method, when fillSpace
is true. It calculates the maximum padding of all content panels, and
then subtracts it from maxHeight to obtain the new panel size. This is
wrong. I, for example, need to use different paddings in different
content divs, and this approach produces wrong results in this case.
The correct thing to do is to subtract each panel's padding

I was able to fix this (in 1.7.2) by replacing this:

var maxPadding = 0; {
       maxPadding = Math.max(maxPadding, $(this).innerHeight() - $
}).height(Math.max(0, maxHeight - maxPadding))

with this: {
       var padding = $(this).innerHeight() - $(this).height();
       $(this).height(Math.max(0, maxHeight - padding));

Please integrate this fix in the dev version, and in 1.7.3.

Change History (5)

comment:1 Changed 14 years ago by Jörn Zaefferer

Description: modified (diff)

comment:2 Changed 13 years ago by Jörn Zaefferer

Resolution: fixed
Status: newclosed

Fixed in r3047.

comment:3 Changed 13 years ago by Jörn Zaefferer

Resolution: fixed
Status: closedreopened

Animations still jumpy for fillSpace.

comment:4 Changed 13 years ago by Jörn Zaefferer

The visual testcase passes when replacing the em-padding with px. Animating an element to 15% of 3em doesn't work that well.

comment:5 Changed 13 years ago by Scott González

Resolution: fixed
Status: reopenedclosed

Closing as this is working with pixels. Handling ems is a separate issue that we already know about.

Note: See TracTickets for help on using tickets.