Skip to content

Commit

Permalink
Fix textfield click
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-radhika-s committed Aug 11, 2023
1 parent 05f4332 commit 640d1d8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import kotlinx.coroutines.launch
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun CountryPickerBottomSheet(
sheetState: SheetState = rememberModalBottomSheetState(skipPartiallyExpanded = true),
sheetState: SheetState = rememberModalBottomSheetState(skipPartiallyExpanded = false),
shape: Shape = BottomSheetDefaults.ExpandedShape,
containerColor: Color = BottomSheetDefaults.ContainerColor,
contentColor: Color = contentColorFor(containerColor),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import androidx.compose.material3.OutlinedTextField
import androidx.compose.material3.OutlinedTextFieldDefaults
import androidx.compose.material3.Text
import androidx.compose.material3.TextFieldColors
import androidx.compose.material3.TextFieldDefaults
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
Expand All @@ -24,7 +23,6 @@ import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.semantics.onClick
import androidx.compose.ui.semantics.semantics
import com.canopas.campose.countrypicker.model.Country
import kotlinx.coroutines.coroutineScope

@OptIn(ExperimentalMaterial3Api::class)
@Composable
Expand Down Expand Up @@ -77,17 +75,13 @@ fun Modifier.expandable(
onExpandedChange: () -> Unit
) = pointerInput(Unit) {
awaitEachGesture {
coroutineScope {
awaitPointerEventScope {
var event: PointerEvent
do {
event = awaitPointerEvent(PointerEventPass.Initial)
} while (
!event.changes.all { it.changedToUp() }
)
onExpandedChange.invoke()
}
}
var event: PointerEvent
do {
event = awaitPointerEvent(PointerEventPass.Initial)
} while (
!event.changes.all { it.changedToUp() }
)
onExpandedChange.invoke()
}
}.semantics {
onClick {
Expand Down

0 comments on commit 640d1d8

Please sign in to comment.