glink/use_focus

Types

pub type Input
pub type Output {
  Output(is_focused: Bool, focus: fn(String) -> Nil)
}

Constructors

  • Output(is_focused: Bool, focus: fn(String) -> Nil)

    Arguments

    is_focused

    Determines whether this component is focused or not.

    focus

    Allows focusing a specific element with the provided ID.

Values

pub fn auto_focus(auto_focus: Bool) -> Input

Auto focus this component, if there’s no active (focused) component right now.

pub fn id(id: Int) -> Input

Assign an ID to this component, so it can be programmatically focused with focus(id).

pub fn is_active(is_active: Bool) -> Input

Enable or disable this component’s focus, while still maintaining its position in the list of focusable components.

Search Document