'DropdownMenu is not positioning correctly

When parent of DropdownMenu is align bottom of the screen then DropdownMenu has a vertical gap between parent and DropdownMenu.

I have tried offset but only x offset is working not y. This the code

Box(
    modifier = Modifier
        .fillMaxSize(),
) {
    var expanded by remember { mutableStateOf(false) }

    Button(
        onClick = { expanded = true },
        modifier = Modifier.align(Alignment.BottomStart)
    ) {
        Text(text = "Drop Down")
    }
    DropdownMenu(
        expanded = expanded,
        onDismissRequest = { expanded = false }
    ) {
        DropdownMenuItem(onClick = { expanded = false }) {
            Text("All Accounts")
        }
        DropdownMenuItem(onClick = { expanded = false }) {
            Text("Deposit")
        }
        DropdownMenuItem(onClick = { expanded = false }) {
            Text("Edit")
        }
    }
}

This is the result image enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source