Source set: Common
public sealed class ExposedDropdownMenuBoxScope
Scope for ExposedDropdownMenuBox.
Functions
menuAnchor
Source set: Common
public abstract fun Modifier.menuAnchor(
type: ExposedDropdownMenuAnchorType,
enabled: Boolean = true,
): Modifier
Modifier which should be applied to an element inside the ExposedDropdownMenuBoxScope, typically a text field or an icon within the text field. It's responsible for requesting focus, and if enabled, expanding/collapsing the menu on click and applying semantics.
Parameters
| type | the type of element that is anchoring the menu. See ExposedDropdownMenuAnchorType. |
| enabled | whether controlling the menu via this anchor is enabled. When false, the component will not expand or collapse the menu in response to user input, and menu semantics will be invisible to accessibility services. Note that this value only controls interactions with the menu. It does not affect the enabled state of other kinds of interactions, such as TextField's enabled parameter. |
exposedDropdownSize
Source set: Common
public abstract fun Modifier.exposedDropdownSize(matchAnchorWidth: Boolean = true): Modifier
Modifier which should be applied to a menu placed inside the ExposedDropdownMenuBoxScope. It will set constraints on the width and height of the menu so it will not overlap the text field or software keyboard.
ExposedDropdownMenu applies this modifier automatically, so this is only needed when using custom menu components.
Parameters
| matchAnchorWidth | whether the menu's width should be forcefully constrained to match the width of the text field to which it's attached. |
ExposedDropdownMenu
Source set: Common
@Deprecated(
message = "Use the version of ExposedDropdownMenu defined as an extension method",
level = DeprecationLevel.HIDDEN,
)
@Composable
public fun ExposedDropdownMenu(
expanded: Boolean,
onDismissRequest: () -> Unit,
modifier: Modifier = Modifier,
scrollState: ScrollState = rememberScrollState(),
matchAnchorWidth: Boolean = true,
shape: Shape = MenuDefaults.shape,
containerColor: Color = MenuDefaults.containerColor,
tonalElevation: Dp = MenuDefaults.TonalElevation,
shadowElevation: Dp = MenuDefaults.ShadowElevation,
border: BorderStroke? = null,
content: @Composable ColumnScope.() -> Unit,
)