From 97c32195b8d10f711eb1be6b119fc66c3a4b9780 Mon Sep 17 00:00:00 2001 From: Ian Harrigan Date: Fri, 7 Jul 2023 16:10:04 +0200 Subject: [PATCH] dont always restore root components to 100% --- haxe/ui/containers/SideBar.hx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/haxe/ui/containers/SideBar.hx b/haxe/ui/containers/SideBar.hx index cfd6e2bb0..3b1819df6 100644 --- a/haxe/ui/containers/SideBar.hx +++ b/haxe/ui/containers/SideBar.hx @@ -219,9 +219,13 @@ class SideBar extends Box { if (r.hidden) { continue; } + if (r.percentWidth == null && r.percentHeight == null) { + continue; + } if (r.classes.indexOf("sidebar") == -1) { r.cachePercentSizes(); r.swapClass("sideBarModifyContent", "sideBarRestoreContent"); + r.addClass("sidebarRestorable"); r.onAnimationEnd = function(_) { r.onAnimationEnd = null; rootComponent.removeClass("sideBarModifyContent"); @@ -381,8 +385,9 @@ class SideBar extends Box { if (r.hidden) { continue; } - if (r.classes.indexOf("sidebar") == -1) { + if (r.classes.indexOf("sidebar") == -1 && r.classes.indexOf("sidebarRestorable") != -1) { r.swapClass("sideBarRestoreContent", "sideBarModifyContent"); + r.removeClass("sidebarRestorable"); r.onAnimationEnd = function(_) { r.restorePercentSizes(); r.onAnimationEnd = null;