Skip to content

Commit 485096f

Browse files
committed
force 0 height in collapsible before animation
1 parent 85bd477 commit 485096f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

haxe/ui/containers/Collapsible.hx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ private class CollapsedBehaviour extends DataBehaviour {
5555
if (_component.animatable) {
5656
if (_value) {
5757
//content.opacity = 0;
58-
var cy = content.height;
5958
var autoHeight = content.autoHeight;
59+
var cy = content.height;
6060
var animation = new AnimationBuilder(content, .3, "ease");
6161
animation.setPosition(0, "height", cy, true);
6262
animation.setPosition(100, "height", 0, true);
@@ -75,8 +75,11 @@ private class CollapsedBehaviour extends DataBehaviour {
7575
} else {
7676
content.hidden = _value;
7777
//content.opacity = 0;
78-
var cy = content.height;
7978
var autoHeight = content.autoHeight;
79+
var cy = content.height;
80+
content.height = 0;
81+
@:privateAccess content._height = 0;
82+
content.validateNow();
8083
var animation = new AnimationBuilder(content, .3, "ease");
8184
animation.setPosition(0, "height", 0, true);
8285
animation.setPosition(100, "height", cy, true);

0 commit comments

Comments
 (0)