@@ -9,7 +9,6 @@ import androidx.compose.animation.fadeOut
99import androidx.compose.animation.slideInVertically
1010import androidx.compose.animation.togetherWith
1111import androidx.compose.foundation.background
12- import androidx.compose.foundation.clickable
1312import androidx.compose.foundation.layout.Arrangement
1413import androidx.compose.foundation.layout.Box
1514import androidx.compose.foundation.layout.BoxWithConstraints
@@ -22,6 +21,8 @@ import androidx.compose.foundation.layout.offset
2221import androidx.compose.foundation.layout.padding
2322import androidx.compose.foundation.layout.size
2423import androidx.compose.foundation.layout.width
24+ import androidx.compose.foundation.selection.selectable
25+ import androidx.compose.foundation.selection.selectableGroup
2526import androidx.compose.foundation.shape.RoundedCornerShape
2627import androidx.compose.material3.Icon
2728import androidx.compose.material3.MaterialTheme
@@ -96,7 +97,11 @@ fun PillTabRow(
9697 )
9798 )
9899
99- Row (modifier = Modifier .fillMaxSize()) {
100+ Row (
101+ modifier = Modifier
102+ .fillMaxSize()
103+ .selectableGroup()
104+ ) {
100105 tabs.forEachIndexed { index, tab ->
101106 val selected = index == selectedIndex
102107 val contentColor = when {
@@ -110,7 +115,8 @@ fun PillTabRow(
110115 .fillMaxHeight()
111116 .padding(IndicatorPadding )
112117 .clip(IndicatorShape )
113- .clickable(
118+ .selectable(
119+ selected = selected,
114120 enabled = enabled,
115121 role = Role .Tab ,
116122 onClick = { onTabSelected(index) }
0 commit comments