Skip to content

Commit

Permalink
Merge pull request #88 from Konyaco/update_tab_row_layout
Browse files Browse the repository at this point in the history
[fluent] Fix: Prevent TabView from exceeding its bounds
  • Loading branch information
Sanlorng authored Dec 1, 2024
2 parents eec0334 + 67ee464 commit 5a56a23
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.widthIn
import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.foundation.layout.wrapContentSize
import androidx.compose.foundation.layout.wrapContentWidth
import androidx.compose.foundation.lazy.LazyListItemInfo
import androidx.compose.foundation.lazy.LazyListScope
import androidx.compose.foundation.lazy.LazyListState
Expand Down Expand Up @@ -154,6 +155,7 @@ fun TabRow(
modifier = Modifier
.onGloballyPositioned { rowRect.value = it.boundsInParent() }
.weight(1f)
.wrapContentWidth(Alignment.Start)
.height(TabViewHeight)
.zIndex(1f)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ internal fun TabViewWindowContent(
) {
Column(modifier = Modifier.windowInsetsPadding(paddingInsets)) {
val selectedIndex = remember { mutableStateOf(1) }
val tabItems = remember { mutableStateListOf(*Array(100) { it + 1 }) }
val tabItems = remember { mutableStateListOf(*Array(6) { it + 1 }) }
val state = rememberLazyListState()
val endDividerController = rememberTabItemEndDividerController(
selectedKey = { selectedIndex.value },
Expand Down

0 comments on commit 5a56a23

Please sign in to comment.