Title here
Summary here
In computing, the focus indicates the component of the graphical user interface which is selected to receive input. A focused view:
The focus is hierarchical, meaning that if a view is focused its parent is focused. It means that multiple views can be focused at the same time, but only one view is focused at a time at the same level of the hierarchy. Find below a visual representation:
The hierarchy focus management is based on the following rules:
_getChildToFocus
),MFocus
feature on it),focus
API usage exampleimport $View from "@View";
import $ListView from "@ListView";
var Rails = $View.declare("Rails", {
children: {
"rail1": {class: $ListView},
"rail2": {class: $ListView}
}
});
var MyView = $View.declare("MyView", {
children: {
"menu": {class: $ListView},
"rails": {class: Rails}
}
});
var myView = new MyView();
myView.menu.focus(); // myView, menu
myView.rails.focus(); // myView, rails
myView.rails.rail2.focus(); // myView, rails, rail2
myView.menu.focus(); // myView, menu
myView.rails.focus(); // myView, rails, rail2
Caution
Don’t use ListView
, they are deprecated. Use RecyclingListView
instead.
The focus management on a ListView
is based on the following rules:
Below a diagram of how it should look: