'detectTapGestures not working in BasicTextField compose android
Im am implementing a custom design that forced me to use BasicTextField, I need to perform the action clearError() when the user taps on the text field. For some reason it doesn't intercept the taps. If I apply pointerInput(Unit) { detectTapGestures { clearError() } } to any outer composables it works but it won't for BasicTextField. Any ideas?
BasicTextField(
modifier = Modifier
.pointerInput(Unit) { detectTapGestures { clearError() } }
.align(Alignment.CenterStart)
.fillMaxWidth(),
value = textFieldState,
onValueChange = { textFieldState = it },
keyboardOptions = KeyboardOptions(keyboardType = keyboardType),
singleLine = true,
textStyle = TextStyle(color = colorResource(id = R.color.white)),
visualTransformation = visualTransformation ?: VisualTransformation.None
)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
