Fixed
Status Update
Comments
so...@google.com <so...@google.com> #2
Thanks! This looks like a bug, thank you for reporting!
ap...@google.com <ap...@google.com> #3
I would also recommend setting the value to 10%. When you do that, the behavior is wild.
Dragging up to 10% or between 50% and 90% will cause it to snap back to the start anchor.
Dragging between 10% and 50% or past 90% will cause it to snap to the end anchor.
Dragging up to 10% or between 50% and 90% will cause it to snap back to the start anchor.
Dragging between 10% and 50% or past 90% will cause it to snap to the end anchor.
Description
val state = state { TextFieldValue() }
TextField(
value = state.value,
onValueChange = { state.value = it }
)
I copy it to my app and there is nothing displayed and I can't understand why.
It happened because the default text is "", it wraps content and the size of the TextField is 0x0 as a result.
It is solved by the material implementation FilledTextField as it provides the default min size, but here we have to solve it differently.
And it is not the first component which is 0x0 by default and we want to force people to think about its size via api. What we did for similar components Spacer and Canvas(from ui-foundation) - we removed the default value for the modifier parameter. In the documentation for Canvas we have "@param modifier mandatory modifier to specify size strategy for this composable".
I propose the same fix for TextField: move modifier to be a first param and remove the default value. We should also update a sample to provide some size like Modifier.size(48.dp)
wdyf?