MFocus

MFocus ⇐ Trait

Make a view focus-able Indicates that the view is of interest and may receive inputs Multiple views can be focused if they are part of the same hierarchy

Kind: global mixin
Extends: Trait
Properties

NameTypeDescription
hasFocusBoolean

Feature flag

isFocusedBoolean

True if the view is currently focused

focusedChildView

child that is (or was last) focused

routerManagerRouterManager

Instance of RouterManager

focus([options])

Focus the view and update focused hierarchy Only one hierarchy can be possible

Kind: instance method of MFocus

ParamTypeDescription
[options]Object

The options

[options.blurOptions]Object

the blur options

[options.focusOptions]Object

the focus options

[options.singletons]Array.<Object>

the common views between 2 screens

getFocusedChildren() ⇒ Array.<View>

Return the list of descendant that are focused

Kind: instance method of MFocus
Returns: Array.<View> - list of descendant that are focused

getFocusedHierarchyIds() ⇒ Array.<string>

Return the list of descendant ids that are focused

Kind: instance method of MFocus
Returns: Array.<string> - list of descendant ids that are focused

getFocusedHierarchyTestId() ⇒ Array

to override focusedHierarchyIds but for tests

Kind: instance method of MFocus

getTestId() ⇒ *

To get test id or id

Kind: instance method of MFocus

_getChildToFocus() ⇒ View

Returns the child that should be focused, following the focus of these view By default, returns the focusedChild, which is the child that is/was focused

Extension point - You can override these method

Kind: instance method of MFocus
Access: protected

_onFocusChanged(previousHierarchy, currentHierarchy, options)

Called following a focus that has changed the focused hierarchy All the views _onFocusChanged methods of the old/new hierarchy are called, even if the view itself did not change its focus

Extension point - You can override these method

Kind: instance method of MFocus
Access: protected

ParamTypeDescription
previousHierarchyArray.<Object>

The previous hierarchy

currentHierarchyArray.<Object>

The current hierarchy

optionsObject

The additionnal params

_onFocus(options)

Called when focused Extension point - You can override these method

Kind: instance method of MFocus
Access: protected

ParamTypeDescription
optionsObject

The additional params

_onBlur(options)

Called when blurred Extension point - You can override these method

Kind: instance method of MFocus
Access: protected

ParamTypeDescription
optionsObject

The additional options