Ian Warwick
01/15/2020, 9:15 AMTextInput
or Text
when I double click on the text it turns the Text
into a TextInput
in the compose tree
@Composable
private fun Text(
element: TextElement,
inEdit: Boolean = false
) {
val textStyle = TextStyle(
background = Color.Transparent,
fontWeight = element.fontWeight,
fontSize = TextUnit.Em(element.fontSize),
color = element.color
)
val spacing =
Spacing(element.spacingLeft.dp, element.spacingTop.dp, element.spacingRight.dp, element.spacingBottom.dp)
if (inEdit) {
TextField(modifier = spacing, value = element.text, textStyle = textStyle, onValueChange = {
element.text = it
})
} else {
Text(modifier = spacing, text = element.text, style = textStyle)
}
}
It seems that even though Text
is being displayed Compose is still receiving text input via the missing TextInput
(see video) possibly.. I would expect that if a recompose occurs then it would not exist in this part of the compose graph anymore 🤔 any ideas?matvei
01/15/2020, 11:24 AMIan Warwick
01/15/2020, 12:04 PMIan Warwick
01/15/2020, 12:33 PMmatvei
01/15/2020, 12:33 PM