Skip to content

Commit

Permalink
fix text field had unwanted padding and misalignment
Browse files Browse the repository at this point in the history
  • Loading branch information
sunny-chung committed Feb 16, 2024
1 parent 1ada71c commit 5598850
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontStyle
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.LineHeightStyle
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextDecoration
import androidx.compose.ui.text.style.TextOverflow
Expand Down Expand Up @@ -46,7 +47,9 @@ fun AppText(
hasHoverHighlight: Boolean = false,
hoverColor: Color = LocalColor.current.highlight,
onTextLayout: ((TextLayoutResult) -> Unit)? = null,
style: TextStyle = LocalTextStyle.current

// https://issuetracker.google.com/issues/325519362
style: TextStyle = LocalTextStyle.current.copy(lineHeightStyle = LineHeightStyle(LineHeightStyle.Alignment.Bottom, LineHeightStyle.Trim.Both))
) {
var textStyle by remember { mutableStateOf(style.copy(fontSize = fontSize)) }
var isReadyToRender by remember { mutableStateOf(!isFitContent) }
Expand Down

0 comments on commit 5598850

Please sign in to comment.