Raxol.Core.FocusManager.FocusServer (Raxol v2.0.1)

View Source

GenServer implementation for focus management.

Provides accessibility focus management with tab ordering, focus history, and component registration.

Summary

Functions

Returns a specification to start this module under a supervisor.

Disable a component from focus.

Enable a component for focus.

Focus next component in tab order.

Focus previous component in tab order.

Get focus history.

Get currently focused element.

Get next focusable component.

Get previous focusable component.

Check if component has focus.

Return to previous focus.

Set focus to a component.

Unregister focus change handler.

Unregister a focusable component.

Types

t()

@type t() :: %Raxol.Core.FocusManager.FocusServer{
  current_focus: binary() | nil,
  enabled_components: MapSet.t(),
  focus_handlers: list(),
  focus_history: list(),
  focusable_components: map(),
  tab_order: list()
}

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

disable_component(server, component_id)

Disable a component from focus.

enable_component(server, component_id)

Enable a component for focus.

focus_next(server, opts \\ [])

Focus next component in tab order.

focus_previous(server, opts \\ [])

Focus previous component in tab order.

get_focus_history(server)

Get focus history.

get_focused_element(server)

Get currently focused element.

get_next_focusable(server, current_focus_id)

Get next focusable component.

get_previous_focusable(server, current_focus_id)

Get previous focusable component.

handle_manager_cast(msg, state)

Callback implementation for Raxol.Core.Behaviours.BaseManager.handle_manager_cast/2.

handle_manager_info(msg, state)

Callback implementation for Raxol.Core.Behaviours.BaseManager.handle_manager_info/2.

has_focus?(server, component_id)

Check if component has focus.

register_focus_change_handler(server, handler_fun)

Register focus change handler.

register_focusable(server, component_id, tab_index, opts \\ [])

Register a focusable component.

return_to_previous(server)

Return to previous focus.

set_focus(server, component_id)

Set focus to a component.

set_initial_focus(server, component_id)

Set initial focus.

start_link(init_opts \\ [])

unregister_focus_change_handler(server, handler_fun)

Unregister focus change handler.

unregister_focusable(server, component_id)

Unregister a focusable component.