summaryrefslogtreecommitdiffhomepage
path: root/android
diff options
context:
space:
mode:
authorDavid Göransson <david.goransson@mullvad.net>2024-10-03 15:20:07 +0200
committerDavid Göransson <david.goransson@mullvad.net>2024-10-08 15:33:14 +0200
commita0d1b2892bdd3f2a8acc197e8f76ada6f43fef79 (patch)
treed49e5574bc621c78377e351d395ddadfa400d3b1 /android
parent56176fe210991fa057d29e1910ed1a02f725bc3a (diff)
downloadmullvadvpn-a0d1b2892bdd3f2a8acc197e8f76ada6f43fef79.tar.xz
mullvadvpn-a0d1b2892bdd3f2a8acc197e8f76ada6f43fef79.zip
Remove old workaround for enter press on dialog
Diffstat (limited to 'android')
-rw-r--r--android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/textfield/CustomTextField.kt17
1 files changed, 1 insertions, 16 deletions
diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/textfield/CustomTextField.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/textfield/CustomTextField.kt
index b64de576ee..5bdcc961e7 100644
--- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/textfield/CustomTextField.kt
+++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/textfield/CustomTextField.kt
@@ -13,7 +13,6 @@ import androidx.compose.runtime.SideEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
-import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
@@ -23,8 +22,6 @@ import androidx.compose.ui.text.input.KeyboardCapitalization
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.text.input.TextFieldValue
import androidx.compose.ui.text.input.VisualTransformation
-import kotlinx.coroutines.delay
-import kotlinx.coroutines.launch
import net.mullvad.mullvadvpn.constant.EMPTY_STRING
import net.mullvad.mullvadvpn.constant.NEWLINE_STRING
@@ -53,9 +50,6 @@ fun CustomTextField(
imeAction = ImeAction.Done,
),
) {
-
- val scope = rememberCoroutineScope()
-
// This is the same implementation as in BasicTextField.kt but with initial selection set at the
// end of the text rather than in the beginning.
// This is a fix for https://issuetracker.google.com/issues/272693535.
@@ -97,16 +91,7 @@ fun CustomTextField(
singleLine = true,
placeholder = placeholderText?.let { { Text(text = it) } },
keyboardOptions = keyboardOptions,
- keyboardActions =
- KeyboardActions(
- onDone = {
- scope.launch {
- // https://issuetracker.google.com/issues/305518328
- delay(100)
- onSubmit(value)
- }
- }
- ),
+ keyboardActions = KeyboardActions(onDone = { onSubmit(value) }),
visualTransformation = visualTransformation,
colors = colors,
isError = !isValidValue,