Interface

FocusTargetModifierNode

This modifier node can be delegated to in order to create a modifier that makes a component focusable.

Source set: Common
public sealed interface FocusTargetModifierNode : DelegatableNode

This modifier node can be delegated to in order to create a modifier that makes a component focusable.

Properties

focusState

Source set: Common
public val focusState: FocusState

The FocusState associated with this FocusTargetModifierNode. When you delegate to a FocusTargetModifierNode, instead of implementing FocusEventModifierNode, you can get the state by accessing this variable.

focusability

Source set: Common
public var focusability: Focusability

The Focusability for this node.

Note that parent FocusPropertiesModifierNodes that set FocusProperties.canFocus take priority over this property.

If the current focus state would be affected by a new focusability, focus will be invalidated as needed.

Functions

requestFocus

Source set: Common
@Deprecated(
        message = "Use the version accepting FocusDirection",
        replaceWith = ReplaceWith("this.requestFocus()"),
        level = DeprecationLevel.HIDDEN,
    )
    public fun requestFocus(): Boolean

Request focus for this node.

Return

true if focus was successfully requested

requestFocus

Source set: Common
public fun requestFocus(focusDirection: FocusDirection = FocusDirection.Enter): Boolean

Request focus for this node.

Parameters

focusDirection The direction from which the focus is being requested

Return

true if focus was successfully requested

Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: