Closed yarikleto closed 4 years ago
Although this is not a huge bottleneck, it looks like a nice optimisation with single sortBy
way. Picking first child seems a bit random though. Could you submit a PR please?
Thank you for your answer. OK
Merged, will be published soon :)
🥳
This method recursively finds a focusable child without his own focusable children.
If the
preferredChildFocusKey
andlastFocusedChildKey
are "disabled", we need to select at least something.Here, we try to find a component closer to (x: 0, y: 0). It's
O(2n)
It's the same.
O(n)
.Or we can just pick a first child. It's very fast :)