feat: add focusable in TextField

This commit is contained in:
2023-11-17 22:09:09 +08:00
parent 1326c74492
commit 7a9cca2a3a

View File

@@ -28,6 +28,7 @@ import androidx.compose.animation.core.animateDpAsState
import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.background
import androidx.compose.foundation.focusable
import androidx.compose.foundation.hoverable
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.interaction.collectIsFocusedAsState
@@ -268,6 +269,7 @@ private fun Modifier.textField(
enabled: Boolean,
interactionSource: MutableInteractionSource
) = status(enabled)
.focusable(enabled, interactionSource)
.hoverable(interactionSource, enabled)
.clip(style.shape)
.background(colors.backgroundColor, style.shape)