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

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 currently open and visible to the user

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 apply to this layout

scrollState: ScrollState = rememberScrollState()

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

content: @Composable ColumnScope.() -> Unit

The content of the ExposedDropdownMenu

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). Also it'll 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 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.