Closed NickGoward closed 5 years ago
Cheers for this @NickGoward . Apologies for the late reply.
Thanks for the reproducible test case. The test should pass, so it suggests there is a fix to be done anyway.
However, as we both said and as you commented, I think we should introduce an optional flag along the lines of "please don't try and find focus" to the unregisterNode
function call, so I'll look into that too.
This has been fixed as of https://github.com/bbc/lrud/pull/24 and publish as lrud@3.5.0 https://www.npmjs.com/package/lrud
Describe the bug When a node is unregistered, LRUD tries to assign focus to something else. This seems to cause an issue when the node being unregistered is higher in the tree than the currently focused node.
To Reproduce
Expected behavior Should remove
item1
. Instead, LRUD throws an error.Personally, I would prefer LRUD not to attempt to focus on anything when I remove a node.