From fcad3614584632f1831cb03f4864de3f11a0c236 Mon Sep 17 00:00:00 2001 From: Ian Harrigan Date: Mon, 7 Oct 2024 11:27:40 +0200 Subject: [PATCH] set currentpage based on the index when adding components --- haxe/ui/containers/Stack.hx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/haxe/ui/containers/Stack.hx b/haxe/ui/containers/Stack.hx index f69b46815..74cc4357e 100644 --- a/haxe/ui/containers/Stack.hx +++ b/haxe/ui/containers/Stack.hx @@ -132,8 +132,12 @@ private class Builder extends CompositeBuilder { _stack.selectedIndex = 0; } var childIndex = _stack.getComponentIndex(child); + trace(childIndex, _stack.selectedIndex); if (childIndex != _stack.selectedIndex) { child.hide(); + } else if (childIndex == _stack.selectedIndex) { + child.show(); + _currentPage = child; } } } \ No newline at end of file