Skip to content

Commit 4b34129

Browse files
authored
Fix tab indicator clipping by removing matchContentSize in JetLaggedHeaderTabs (#1707)
## Description This PR fixes issue #1703 where the tab selection indicator in the `JetLagged` sample was incorrectly sized and clipping the label text. <img width="1344" height="2992" alt="Screenshot_20260829_053440" src="https://github.com/user-attachments/assets/491ff2b9-e999-4c37-ba32-a63d748d34d5" /> ### Changes: - Removed `matchContentSize = true` from `.tabIndicatorOffset()` in the indicator implementation. - By disabling content matching (returning to default behavior), the indicator box now fills the entire tab slot, providing enough space to comfortably encapsulate the label text without clipping. ### Verification: - Verified via Compose Preview: The indicator now correctly encloses the entire label (e.g., "Day", "Week") without any clipping. - Verified on Emulator: The selection box aligns perfectly with the tab's clickable area. ## Related Issues Fixes #1703
2 parents 5f2f2cf + 5d15a04 commit 4b34129

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎JetLagged/app/src/main/java/com/example/jetlagged/sleep/JetLaggedHeaderTabs.kt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ fun JetLaggedHeaderTabs(onTabSelected: (SleepTab) -> Unit, selectedTab: SleepTab
5353
indicator = {
5454
Box(
5555
Modifier
56-
.tabIndicatorOffset(selectedTab.ordinal, matchContentSize = true)
56+
.tabIndicatorOffset(selectedTab.ordinal)
5757
.fillMaxSize()
5858
.padding(horizontal = 2.dp)
5959
.border(

0 commit comments

Comments
 (0)