This crate is a part of rat-salsa.
For examples see rat-focus GitHub.
Focus handling for ratatui
This crate works by adding a FocusFlag to each widget's state.
Then FocusBuilder is used to collect an ordered list of all widgets that should be considered for focus handling. It builds the Focus which has the functions next, prev and focus_at that can do the navigation.
from <focus_input1.rs>
- Keeps the focus-state close to the widgets code.
- Rebuilt for each event.
- No need to update the widget list when the application state changes.
- FocusBuilder can be passed on all over the application to build the widget tree.