https://kotlinlang.org logo
d

Deepak Gahlot

02/25/2021, 4:48 AM
What happened to TextField in beta:01
Copy code
TextField(
    modifier = Modifier
        .fillMaxWidth()
        .padding(0.dp, 0.dp, 0.dp, 0.dp)
        .constrainAs(textField) {
            top.linkTo(<http://parent.top|parent.top>)
        },
    enabled = if (questions.editable != null) questions.editable else false,
    backgroundColor = if ((questions.editable != null) && (questions.editable)) colorResource(
        id = R.color.white
    ) else colorResource(id = R.color.gray5),
    value = text!!,
    textStyle = TextStyle(Color(R.color.black)),
    singleLine = true,
               onValueChange = {
        text = it
        textCount = text!!.length
        MappingUtils.getAnswerForItemId(
            questions.itemId!!,
            text!!,
            aList = qResponse.answers,
            null,
            false
        )
    },
    inactiveColor = colorResource(id = R.color.gray9),
    activeColor = colorResource(id = R.color.blue1)
)
It says cannot find TextField
s

Shabinder Singh

02/25/2021, 4:58 AM
remove inactive color /active color , and replace it with textFieldColors()
d

Deepak Gahlot

02/25/2021, 4:58 AM
shall i remove the backgroundcolor as well
s

Shabinder Singh

02/25/2021, 4:59 AM
yup
🙌 1
1
d

Deepak Gahlot

02/25/2021, 6:41 AM
Also what is the replacement for
Copy code
onTextInputStarted = { keyboardController.value = it },
i see in the new TextField it has been removed
s

Se7eN

02/25/2021, 12:51 PM