I'm trying to create a OTP text input field. I'm u...
# compose-android
c
I'm trying to create a OTP text input field. I'm using BasicTextField and so this is all pretty darn simple at this point. But on android the "tooltip" to "Paste" after long clicking on the text input doesn't appear on the screen. Am I missing something? Heres my code
Copy code
BasicTextField(
        value = otpCode,
        modifier = Modifier.focusRequester(focusRequester),
        onValueChange = { newValue ->
            if (newValue.length <= 6) {
                update(newValue)
            }
        },
        keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.NumberPassword)
    ) {
        Row(horizontalArrangement = Arrangement.spacedBy(10.dp)) {
            repeat(6) { index ->
                val number =
                    when {
                        index >= otpCode.length -> ""
                        else -> otpCode[index].toString()
                    }

                Column(
                    horizontalAlignment = Alignment.CenterHorizontally,
                    verticalArrangement = Arrangement.spacedBy(6.dp)
                ) {
                    Text(
                        text = number,
                        color = Color.White,
                        style = MaterialTheme.typography.titleLarge,
                    )

                    Box(
                        modifier = Modifier
                            .width(40.dp)
                            .height(2.dp)
                            .background(Color.White)
                    )
                }
            }
        }
    }
z
Does the popup just not appear at all, or it shows up but is missing the paste action?
c
Now after trying again, it shows... but it shows in the complete upper right of the screen, under the status bar so I can't even click on it. The only action that shows is paste (which is good, since its OTP 😄 )