Raxol.UI.Components.Input.SelectList.Selection (Raxol v2.0.1)

View Source

Selection management for SelectList component.

Summary

Functions

Gets the currently selected option.

Gets the value of the currently selected option.

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

get_selected_option(state)

@spec get_selected_option(Raxol.UI.Components.Input.SelectList.t()) :: any() | nil

Gets the currently selected option.

get_selected_value(state)

@spec get_selected_value(Raxol.UI.Components.Input.SelectList.t()) :: any() | nil

Gets the value of the currently selected option.

is_selected?(state, index)

This function is deprecated. Use selected?/2 instead.

move_down(state)

Moves selection down by one.

move_up(state)

Moves selection up by one.

select_by_value(state, target_value)

Selects an option by its value.

select_first(state)

Moves selection to the first item.

select_last(state)

Moves selection to the last item.

selected?(state, index)

Checks if an index is the selected one.

update_selection_state(state, index)

Updates the selection state with a new index.