Raxol.UI.Components.Input.SelectList.Selection (Raxol v2.0.1)
View SourceSelection management for SelectList component.
Summary
Functions
Gets the currently selected option.
Gets the value of the currently selected option.
is_selected?(state, index)
deprecated
Moves selection down by one.
Moves selection up by one.
Selects an option by its value.
Moves selection to the first item.
Moves selection to the last item.
Checks if an index is the selected one.
Updates the selection state with a new index.
Functions
@spec get_selected_option(Raxol.UI.Components.Input.SelectList.t()) :: any() | nil
Gets the currently selected option.
@spec get_selected_value(Raxol.UI.Components.Input.SelectList.t()) :: any() | nil
Gets the value of the currently selected option.
This function is deprecated. Use selected?/2 instead.
@spec move_down(Raxol.UI.Components.Input.SelectList.t()) :: {Raxol.UI.Components.Input.SelectList.t(), list()}
Moves selection down by one.
@spec move_up(Raxol.UI.Components.Input.SelectList.t()) :: {Raxol.UI.Components.Input.SelectList.t(), list()}
Moves selection up by one.
@spec select_by_value(Raxol.UI.Components.Input.SelectList.t(), any()) :: {Raxol.UI.Components.Input.SelectList.t(), list()}
Selects an option by its value.
@spec select_first(Raxol.UI.Components.Input.SelectList.t()) :: {Raxol.UI.Components.Input.SelectList.t(), list()}
Moves selection to the first item.
@spec select_last(Raxol.UI.Components.Input.SelectList.t()) :: {Raxol.UI.Components.Input.SelectList.t(), list()}
Moves selection to the last item.
@spec selected?(Raxol.UI.Components.Input.SelectList.t(), non_neg_integer()) :: boolean()
Checks if an index is the selected one.
@spec update_selection_state( Raxol.UI.Components.Input.SelectList.t(), non_neg_integer() ) :: {Raxol.UI.Components.Input.SelectList.t(), list()}
Updates the selection state with a new index.