Raxol.Core.FocusManager (Raxol v2.0.1)
View SourceRefactored FocusManager that delegates to GenServer implementation.
This module provides the same API as the original FocusManager but uses a supervised GenServer instead of the Process dictionary for state management.
Migration Notice
This module is a drop-in replacement for Raxol.Core.FocusManager.
All functions maintain backward compatibility while providing improved
fault tolerance and functional programming patterns.
Benefits over Process Dictionary
- Supervised state management with fault tolerance
- Pure functional transformations
- Better debugging and testing capabilities
- Clear separation of concerns
- No global state pollution
Summary
Functions
Disable a focusable component, preventing it from receiving focus.
Enable a previously disabled focusable component.
Ensures the FocusManager server is started. Called automatically when using any function.
Move focus to the next focusable element.
Move focus to the previous focusable element.
Alias for get_focused_element/0.
Gets the focus history.
Get the ID of the currently focused element.
Get the next focusable element after the given one.
Get the previous focusable element before the given one.
Check if a component has focus.
Register a handler function to be called when focus changes.
Register a focusable component with the focus manager.
Return to the previously focused element.
Set focus to a specific component.
Set the initial focus to a specific component.
Unregister a focus change handler function.
Unregister a focusable component.
Functions
Disable a focusable component, preventing it from receiving focus.
Enable a previously disabled focusable component.
Ensures the FocusManager server is started. Called automatically when using any function.
Move focus to the next focusable element.
Move focus to the previous focusable element.
Alias for get_focused_element/0.
Gets the focus history.
Get the ID of the currently focused element.
Get the next focusable element after the given one.
Get the previous focusable element before the given one.
Check if a component has focus.
Register a handler function to be called when focus changes.
Register a focusable component with the focus manager.
Return to the previously focused element.
Set focus to a specific component.
Set the initial focus to a specific component.
Unregister a focus change handler function.
Unregister a focusable component.