{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

ExposedDropdownMenuBoxScope

@ExperimentalMaterial3Api
public abstract class ExposedDropdownMenuBoxScope


Scope for ExposedDropdownMenuBox.

Summary

Public constructors

Public methods

final void
@Composable
ExposedDropdownMenu(
    boolean expanded,
    @NonNull Function0<Unit> onDismissRequest,
    @NonNull Modifier modifier,
    @NonNull ScrollState scrollState,
    @Composable @ExtensionFunctionType @NonNull Function1<@NonNull ColumnScopeUnit> content
)

Popup which contains content for Exposed Dropdown Menu.

abstract @NonNull Modifier
exposedDropdownSize(
    @NonNull Modifier receiver,
    boolean matchTextFieldWidth
)

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

abstract @NonNull Modifier

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

Public constructors

ExposedDropdownMenuBoxScope

public ExposedDropdownMenuBoxScope()

Public methods

ExposedDropdownMenu

@Composable
public final void ExposedDropdownMenu(
    boolean expanded,
    @NonNull Function0<Unit> onDismissRequest,
    @NonNull Modifier modifier,
    @NonNull ScrollState scrollState,
    @Composable @ExtensionFunctionType @NonNull Function1<@NonNull ColumnScopeUnit> content
)

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

Parameters
boolean expanded

whether the menu is expanded

@NonNull Function0<Unit> onDismissRequest

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

@NonNull Modifier modifier

the Modifier to be applied to this menu

@NonNull ScrollState scrollState

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

@Composable @ExtensionFunctionType @NonNull Function1<@NonNull ColumnScopeUnit> content

the content of the menu

exposedDropdownSize

public abstract @NonNull Modifier exposedDropdownSize(
    @NonNull Modifier receiver,
    boolean matchTextFieldWidth
)

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
boolean matchTextFieldWidth

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

public abstract @NonNull Modifier menuAnchor(@NonNull Modifier receiver)

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.