Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jetpack Compose - TextField cuts text on the bottom

I have a TextField

TextField(
        keyboardOptions = KeyboardOptions.Default.copy(
            imeAction = ImeAction.Search,
        ),
        keyboardActions = KeyboardActions(
            onSearch = {
                onSearchTextSubmit(searchText)
            },
        ),
        modifier = Modifier.focusRequester(focusRequester),
        singleLine = true
    )

the I click "Enter" on keyboard the input gets cut from the bottom.

The TextField is inside TopAppBar and I don't set any height or text size explicitly. Is decreasing text size the only way to make it look good or there is a way to force TextField to adjust its height or text size out of the box?

like image 788
Rainmaker Avatar asked Oct 11 '25 10:10

Rainmaker


1 Answers

You need to increase the height of the field by a modifier that looks like this:

modifier = Modifier.height(56.dp), //56 or higher!

Thus, todays options are:

  1. Increase the height of the TextField
  2. Decrease the size of the font
like image 177
Etienne Kaiser Avatar answered Oct 14 '25 00:10

Etienne Kaiser