Zoltan Demant
10/06/2026, 2:30 PMZoltan Demant
10/06/2026, 2:31 PMprivate class EmptyLineOutput(
private val inner: OutputTransformation?,
) : OutputTransformation {
override fun TextFieldBuffer.transformOutput() {
inner?.run { transformOutput() }
if (length == 0) append(ZERO_WIDTH_SPACE)
}
}
private const val ZERO_WIDTH_SPACE = "\u200B"Sargun Vohra
10/07/2026, 2:45 AMZoltan Demant
10/07/2026, 8:05 AMHalil Ozercan
10/07/2026, 7:59 PMdorche
10/07/2026, 9:55 PMverticalPadding (2x) + floatingLabelLineHeight + 4 + textLineHeight where 4 is that magical fudge number that seemed to work for me to stop any weird resizing...
Looks like I left references to https://github.com/JetBrains/compose-multiplatform/issues/1895 and https://bugs.chromium.org/p/skia/issues/detail?id=11321 as possible root causes (or my font) but never really had the time to confirm if that's really the case.
Btw it seemed to only happen when the text field has a (floating) label.Zoltan Demant
10/08/2026, 3:20 AMBasicTextField has it too. It comes from the text styles line height afaik, doing this is also a solution (not sure about side effects, but none of my tests complain):
textStyle =
textStyle.copy(
lineHeight = if (singleLine) Unspecified else textStyle.lineHeight,
),Zoltan Demant
10/08/2026, 3:21 AMsindrenm
10/08/2026, 10:10 AMJonathan
10/08/2026, 12:53 PMBasicTextField would fix it because you can customize the “decorationBox” that holds the actual rendered text.
It’s there that you should apply a Modifier that enforces the minHeight to be the tallest possible value (capture this from the layout inspector).