Hello all, I have a problem with compose and some ...
# compose
j
Hello all, I have a problem with compose and some small devices when the keyboard is opened immediately it closes by itself but it only happens on small devices video in the thread
my composable is a lazy column the text fields are built from a list something like
Copy code
itemsIndexed(items = answer.sections) { index, section ->
    val textFieldState: TextFieldState =
        rendering.formState.getState(section.id)

    when (section.type) {
        TYPE_TEXT -> {
            OutlinedTextField(
                maxLines = 1,
                value = textFieldState.value,
                onValueChange = {
                    textFieldState.change(it)
                },
                label = {
                    CompositionLocalProvider(
                        LocalContentAlpha provides ContentAlpha.medium
                    ) {
                        Text(
                            text = lokaliseResource(lokaliseKey = section.hint),
                            color = HapiTheme.colors.textPrimary,
                            style = bodyRegularL,
                            textAlign = TextAlign.Center
                        )
                    }
                },
                modifier = Modifier
                    .fillMaxWidth()
                    .padding(
                        PaddingValues(
                            start = 30.dp,
                            end = 30.dp,
                            top = 10.dp
                        ),
                    ),
                textStyle = TextStyle(
                    color = colors.textPrimary,
                   fontFamily = bodyRegularL.fontFamily,
                    fontWeight = bodyRegularL.fontWeight,
                    fontSize = bodyRegularL.fontSize
                ),
                isError = textFieldState.hasError,
                keyboardOptions = KeyboardOptions.Default.copy(
                    imeAction = if (index == answer.sections.size - 1)
                        ImeAction.Done else ImeAction.Next,
                    capitalization = KeyboardCapitalization.None
                ),
                keyboardActions = KeyboardActions(
                    onDone = {
                     
                    }
                ),
                colors = TextFieldDefaults.outlinedTextFieldColors(
                    backgroundColor = colors.textFieldBackground,
                    focusedBorderColor = violet2Hapi,
                    unfocusedBorderColor = darkGreyVioletHapi,
                    disabledBorderColor = gray3Hapi,
                    errorBorderColor = if (textFieldState.hasError) {
                        colors.error
                    } else {
                        colors.textLink
                    },
                    cursorColor = darkGrey1Hapi,
                    errorCursorColor = darkGrey1Hapi,
                    focusedLabelColor = violet2Hapi
                ),
                shape = RoundedCornerShape(12.dp),
                enabled = true,
            )

        }
    }
}
z
j
yes 😞
thanks @Zach Klippenstein (he/him) [MOD]