I can't get a BasicTextField to sit nicely on top ...
# compose
p
I can't get a BasicTextField to sit nicely on top of the keyboard when edge-to-edge is enabled:
Copy code
class MainActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
       enableEdgeToEdge()
        setContent {
            TextFieldScrollTestTheme {
                MainScreen()
            }
        }
    }
}


@Composable
fun MainScreen() {

    Scaffold(
        contentWindowInsets = WindowInsets.safeDrawing,
    ) { innerPadding ->
        MyScreenWithInput(innerPadding)
    }
}

@Composable
fun MyScreenWithInput(innerPadding: PaddingValues) {
    var text by remember { mutableStateOf("") }

    Column(
        modifier = Modifier
            .fillMaxSize()
            .imePadding()
            .padding(innerPadding)
    ) {
        LazyColumn(
            modifier = Modifier
                .weight(1f)
                .fillMaxWidth()
                .background(Color.Red),
            contentPadding = PaddingValues(bottom = 8.dp)
        ) {
            items(100) { index ->
                Text(
                    text = "Item $index",
                    modifier = Modifier
                        .fillMaxWidth()
                        .padding(8.dp)
                        .background(Color.LightGray)
                )
            }
        }

        Column(
            Modifier
                .fillMaxWidth()
                .background(Color(0xFFEFEFEF))
                .padding(16.dp)
        ) {
            BasicTextField(
                value = text,
                onValueChange = { text = it },
                modifier = Modifier
                    .fillMaxWidth()
                    .height(100.dp)
                    .background(Color.Green)
                    .padding(8.dp)
            )
            Text(
                text = "Type here $text",
                modifier = Modifier
                    .fillMaxWidth()
                    .padding(top = 8.dp)
                    .background(Color.Yellow)
                    .padding(8.dp)
            )
        }
    }
}
The contents of the whole screen just shoot right to the top. I've tried both adjustResize and adjustNothing If I put imePadding() on the BasicTextField instead, it obscures the bottom of the LazyColumn, which is not what I want either, I want that to push up so the bottom items are visible. Edit: this Compose BOM 2025.07.00
🧵 3
e
Can you please move the bulk of the question into this thread? Its taking up unnecessary real estate in the channel
To solve your issue, check the documentation of
WindowInsets.safeDrawing