A new config object is given to unregisterNode(). One of these options, forceRefocus will make LRUD find a new node to focus on if unregistering the currently focused node.
To match current behaviour, forceRefocus defaults to true.
Also fixes an underlying refocus on unregister issue.
Agree in principle - there are simply some scenarios where LRUD will not be able find a good fit to focus on. In this case, the developer should call assignFocus after unregisterNode in API-land.
How Has This Been Tested?
New unit tests
Screenshots (if appropriate):
Types of changes
[x] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist:
[x] My code follows the code style of this project.
[x] My change requires a change to the documentation.
Description
A new config object is given to
unregisterNode()
. One of these options,forceRefocus
will make LRUD find a new node to focus on if unregistering the currently focused node.To match current behaviour,
forceRefocus
defaults to true.Also fixes an underlying refocus on unregister issue.
Motivation and Context
Suggested by https://github.com/bbc/lrud/issues/23
Agree in principle - there are simply some scenarios where LRUD will not be able find a good fit to focus on. In this case, the developer should call
assignFocus
afterunregisterNode
in API-land.How Has This Been Tested?
New unit tests
Screenshots (if appropriate):
Types of changes
Checklist: