Fix potential error:
Modifier factory functions must use the receiver Modifier instance
This commit is contained in:
parent
5669aa27e6
commit
505bd5c738
1 changed files with 2 additions and 1 deletions
|
|
@ -21,9 +21,10 @@ import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.focus.FocusManager
|
import androidx.compose.ui.focus.FocusManager
|
||||||
import androidx.compose.ui.input.pointer.pointerInput
|
import androidx.compose.ui.input.pointer.pointerInput
|
||||||
|
|
||||||
fun Modifier.clearFocusOnTap(focusManager: FocusManager): Modifier =
|
fun Modifier.clearFocusOnTap(focusManager: FocusManager): Modifier = then(
|
||||||
pointerInput(Unit) {
|
pointerInput(Unit) {
|
||||||
detectTapGestures(onTap = {
|
detectTapGestures(onTap = {
|
||||||
focusManager.clearFocus()
|
focusManager.clearFocus()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue