Repository navigation
feat: add clearLastFocusedChild(focusKey) to core - #250
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: 9563d89 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Braggiouy
marked this pull request as ready for review
October 22, 2026 08:06
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.

Overview
Adds a public
clearLastFocusedChild(focusKey)to make a container forget its last focused child. The next time focus enters the container, it goes topreferredChildFocusKey(or the first child). Focus is not moved, and the container keeps remembering children as usual afterwards.Why
There is currently no public way to clear a container's remembered child once.
saveLastFocusedChild: falsedisables the memory permanently, and it can't be toggled at runtime because it is only read when the component registers.Changes
SpatialNavigationService.clearLastFocusedChild(focusKey), bound and exported like the other public functions. No-op for unknown keys.preferredChildFocusKey; focus is not moved; unknown keys don't throw.docs/api-reference/SpatialNavigation.md.-coreand the legacynorigin-spatial-navigationpackage (it re-exports core).Usage