Skip to content

Moved global methods, new features for focus restore and boundary directions

Compare
Choose a tag to compare
@asgvard asgvard released this 11 Sep 14:21
· 22 commits to main since this release

Added

  • New property for useFocusable - focusBoundaryDirections, array of directions to block when isFocusBoundary is enabled
  • New property useFocusable - forceFocus to mark the component to be the target for auto-restore focus logic when focus is lost
  • New global method doesFocusableExist to check if the focusable component exists before setting focus on it. Safety feature

Changed

  • [BREAKING] Top level exports setFocus, getCurrentFocusKey, navigateByDirection, pause, resume, updateAllLayouts are now exported from SpatialNavigation instead of useFocusable hook.

Fixed

  • Context display name is now called FocusContext in React Devtools
  • Updating lastFocusedChildKey for newly added parent components