Skip to content

Commit

Permalink
set currentpage based on the index when adding components
Browse files Browse the repository at this point in the history
  • Loading branch information
ianharrigan committed Oct 7, 2024
1 parent 44e663d commit fcad361
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions haxe/ui/containers/Stack.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}

0 comments on commit fcad361

Please sign in to comment.