@noriginmedia/norigin-spatial-navigation
Advanced tools
Changelog
[2.1.0]
init
config option shouldUseNativeEvents
that enables the use of native events for triggering actions, such as clicks or key presses.init
config option rtl
that changes focus behavior for layouts in right-to-left (RTL) languages such as Arabic and Hebrew.Changelog
[2.0.2]
ref
to useFocusable
ArrowRight
.Changelog
[2.0.0]
useFocusable
- focusBoundaryDirections
, array of directions to block when isFocusBoundary
is enableduseFocusable
- forceFocus
to mark the component to be the target for auto-restore focus logic when focus is lostdoesFocusableExist
to check if the focusable component exists before setting focus on it. Safety featuresetFocus, getCurrentFocusKey, navigateByDirection, pause, resume, updateAllLayouts
are now exported from SpatialNavigation
instead of useFocusable
hook.FocusContext
in React DevtoolslastFocusedChildKey
for newly added parent componentsChangelog
[1.3.3]
parentsHavingFocusedChild
array after removalautoRestoreFocus
logic to trigger not only on Lead components, but also on Parents that had focused child when being removed. Edge case, normally children are removed first.Changelog
[1.3.2]
hasFocusedChild
when new child is created and focused right awaylastFocusedChild
was updated only on blur, but not on manual focus, resulting in a wrong key being storeduseFocusedContext
file to useFocusContext
to match the export nameChangelog
[1.3.1]
focused
state to false
on unmount. This is to support "double-mount" in Strict mode in React 18.useEffectOnce
hook that introduced issues with unmounted components being remained as focusable.Changelog
[1.3.0]
init
config option shouldFocusDOMNode
that focuses the underlying accessible DOM node too.Changelog
[1.2.0]
init
config option useGetBoundingClientRect
that affects the measurements of sizes and coordinates.Changelog
[1.1.5]
setThrottle
to dynamically change throttle time.unbindEventHandlers
regardless of throttle value