Skip to content

Instantly share code, notes, and snippets.

@ziglee
Created February 19, 2024 09:27
Show Gist options
  • Save ziglee/f68e581493070148373e0a36e9fc49b4 to your computer and use it in GitHub Desktop.
Save ziglee/f68e581493070148373e0a36e9fc49b4 to your computer and use it in GitHub Desktop.
Compose clickable readonly textfield
OutlinedTextField(
modifier = Modifier
.pointerInput(Unit) {
awaitEachGesture {
awaitFirstDown(pass = PointerEventPass.Initial)
val upEvent =
waitForUpOrCancellation(pass = PointerEventPass.Initial)
if (upEvent != null) {
onClick()
}
}
},
readOnly = true,
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment