compose-web: TextArea does not show newlines
Hi! When I load a string into a TextArea, the newline characters are ignored. The other way (retrieving the value from the TextArea after a user-input with newlines was done) works as expected. Can someone confirm this problem? Did I do something wrong, or is there another way / a workaround to somehow set a multiline string in a TextArea?
I just noticed, that newlines appear when setting the text with
TextArea { value(s) }
but I do not know how to allow user input here, so instead I use
TextArea { defaultValue(s) }
and this is where the problem with the ignored newlines appears.
val inputState = remember { mutableStateOf("Some Text") }
TextArea {
value(inputState.value)
onInput { event -> println(event.value) }
}
This is how TextArea can take user's input. (https://github.com/JetBrains/compose-jb/blob/master/tutorials/Web/Controlled_Uncontrolled_Inputs/README.md)