Repository navigation
fix(focus): enclosing leaf search and claim patience - #133
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two FocusManager fixes from moving Plex's Lightning app onto native-style focus.
Enclosing leaf (RNG-901): Down treated any sibling that encloses the source vertically as below it. That's meant for a screen scene behind a floating header, but it also hit leaves, so a full-height gutter catcher won Down from the last row of every screen without its own trap. The rule now only applies to targets with focusable children, roughly what Android's FocusFinder does. Also guards a NaN in
getAlignmentso a 0x0 focused element can still move.Claim patience (RNG-898): a claim resolved its destinations once and then held on forever. It now gets a second, like tvOS and Android. A destination key that registers late gets focus if focus is still in the claim and the user hasn't moved (D-pad or a landed
focusByKey). A claim with nothing to land on loses to the next candidate after that second instead of parking focus on an empty group. Unfocusable targets also wait the full second here, because Lightning elements often turn focusable only after layout.Cost is limited to while a claim is pending (one timer, no polling). Should make
useLightningClaimPatiencein the app redundant once bumped.Tests: 370 pass, new specs for both fixes (7 of them fail without the fixes). Changesets included (patch).