From c89e7f38e44a8ad2f1e67d8c9690589717fa3eb6 Mon Sep 17 00:00:00 2001 From: Abe White Date: Thu, 22 Aug 2024 23:48:42 -0500 Subject: [PATCH] Fix bug related to stack layout within scroll views --- Sources/SkipUI/SkipUI/Compose/ComposeContainer.swift | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Sources/SkipUI/SkipUI/Compose/ComposeContainer.swift b/Sources/SkipUI/SkipUI/Compose/ComposeContainer.swift index 623cc5f4..9143875d 100644 --- a/Sources/SkipUI/SkipUI/Compose/ComposeContainer.swift +++ b/Sources/SkipUI/SkipUI/Compose/ComposeContainer.swift @@ -45,9 +45,10 @@ import androidx.compose.ui.Modifier var modifier = modifier let inheritedScrollAxes = EnvironmentValues.shared._scrollAxes var totalScrollAxes = inheritedScrollAxes - if fixedWidth { + if fixedWidth || axis == .vertical { totalScrollAxes.remove(Axis.Set.horizontal) - } else if isFillWidth.value { + } + if !fixedWidth && isFillWidth.value { if fillWidth { modifier = modifier.fillWidth() } else if inheritedScrollAxes.contains(Axis.Set.horizontal) { @@ -56,9 +57,10 @@ import androidx.compose.ui.Modifier modifier = modifier.fillWidth() } } - if fixedHeight { + if fixedHeight || axis == .horizontal { totalScrollAxes.remove(Axis.Set.vertical) - } else if isFillHeight.value { + } + if !fixedHeight && isFillHeight.value { if fillHeight { modifier = modifier.fillHeight() } else if inheritedScrollAxes.contains(Axis.Set.vertical) {