ExposedDropdownMenuBoxScope


Scope for ExposedDropdownMenuBox.

Summary

Public constructors

android

Public functions

Unit
@Composable
ExposedDropdownMenu(
    expanded: Boolean,
    onDismissRequest: () -> Unit,
    modifier: Modifier,
    scrollState: ScrollState,
    content: @Composable ColumnScope.() -> Unit
)

Popup which contains content for Exposed Dropdown Menu.

android
abstract Modifier
Modifier.exposedDropdownSize(matchTextFieldWidth: Boolean)

Modifier which should be applied to an ExposedDropdownMenu placed inside the scope.

android
abstract Modifier

Modifier which should be applied to a TextField (or OutlinedTextField) placed inside the scope.

android

Public constructors

ExposedDropdownMenuBoxScope

ExposedDropdownMenuBoxScope()

Public functions

ExposedDropdownMenu

@Composable
fun ExposedDropdownMenu(
    expanded: Boolean,
    onDismissRequest: () -> Unit,
    modifier: Modifier = Modifier,
    scrollState: ScrollState = rememberScrollState(),
    content: @Composable ColumnScope.() -> Unit
): Unit

Popup which contains content for Exposed Dropdown Menu. Should be used inside the content of ExposedDropdownMenuBox.

Parameters
expanded: Boolean

whether the menu is expanded

onDismissRequest: () -> Unit

called when the user requests to dismiss the menu, such as by tapping outside the menu's bounds

modifier: Modifier = Modifier

the Modifier to be applied to this menu

scrollState: ScrollState = rememberScrollState()

a ScrollState to used by the menu's content for items vertical scrolling

content: @Composable ColumnScope.() -> Unit

the content of the menu

exposedDropdownSize

abstract fun Modifier.exposedDropdownSize(matchTextFieldWidth: Boolean = true): Modifier

Modifier which should be applied to an ExposedDropdownMenu placed inside the scope. It's responsible for setting the width of the ExposedDropdownMenu, which will match the width of the TextField (if matchTextFieldWidth is set to true). It will also change the height of ExposedDropdownMenu, so it'll take the largest possible height to not overlap the TextField and the software keyboard.

Parameters
matchTextFieldWidth: Boolean = true

whether the menu should match the width of the text field to which it's attached. If set to true, the width will match the width of the text field.

menuAnchor

abstract fun Modifier.menuAnchor(): Modifier

Modifier which should be applied to a TextField (or OutlinedTextField) placed inside the scope. It's responsible for properly anchoring the ExposedDropdownMenu, handling semantics of the component, and requesting focus.