Skip to main content

Search and Top Navigation

#11952 closed bug (notabug)

Opened April 14, 2015 07:58AM UTC

Closed April 14, 2015 01:23PM UTC

Last modified April 15, 2015 01:05PM UTC

heightStyle "fill" option works incorrect if accordion container height set in %

Reported by: maximalist Owned by:
Priority: minor Milestone: none
Component: ui.accordion Version: 1.11.2
Keywords: Cc:
Blocked by: Blocking:
Description

In my case height is 100%

Test example with original markup and CSS

I have solve the problem by addiing event listener on window resize.

var a = $("#accordion_container");

a.accordion( { collapsible: true, heightStyle: "fill" } );

$(window).resize( function() {

var h = a.height();

a.find(".ui-accordion-header").each(function() {

var e = $(this);

if(e.css("display") != "none")

h -= e.outerHeight(true);

});

a.find(".ui-accordion-content").css("height", h);

});

$(window).resize();

Since it is technically possible, I would like it to be implemented in mainstreame.

Attachments (0)
Change History (4)

Changed April 14, 2015 01:23PM UTC by scottgonzalez comment:1

resolution: → notabug
status: newclosed

This is handled by the refresh method. See http://api.jqueryui.com/accordion/#method-refresh.

Changed April 15, 2015 08:01AM UTC by maximalist comment:2

No it is not. Please look at example

Changed April 15, 2015 08:04AM UTC by maximalist comment:3

No it is not. Please look at example

Replying to [comment:1 scott.gonzalez]:

This is handled by the refresh method. See http://api.jqueryui.com/accordion/#method-refresh.

Changed April 15, 2015 01:05PM UTC by scottgonzalez comment:4

That's quite a complicated test case. Can you reduce to only using percent-based heights to prove that the ticket is accurate?