Releases: NoriginMedia/Norigin-Spatial-Navigation
Releases · NoriginMedia/Norigin-Spatial-Navigation
Release list
New callback `onArrowRelease`
Added
- New callback
onArrowReleasethat is called when Arrow key is released on a component. Receives thedirectionandextraPropsas params.
data-focused attribute for focused items
[2.2.3]
- Enhanced focus behavior by adding and removing the
data-focusedattribute during focus transitions. This allows to check if the item has focus via DOM attributes. Can be useful for e2e tests automation.
Exporting top level core service
Dynamic RTL Support and Custom Distance Calculation Enhancements
[2.2.1]
Added
- New init config option
distanceCalculationMethodthat allows switching between edge-based, center-based and corner-based (default) distance calculations. - Support for a custom distance calculation function via the
customDistanceCalculationFunctionoption, enabling custom logic for determining distances between focusable components. This will override thegetSecondaryAxisDistancemethod. - Added
updateRTLmethod to update the RTL behavior dynamically. This method allows toggling the Right-to-Left layout at runtime, updating the spatial navigation behavior without requiring reinitialization.
domNodeFocusOptions support
Added
- new
initconfig optiondomNodeFocusOptionsfor passing FocusOptions when usingshouldFocusDOMNode
RTL support, native events support
Added
- new
initconfig optionshouldUseNativeEventsthat enables the use of native events for triggering actions, such as clicks or key presses. - new
initconfig optionrtlthat changes focus behavior for layouts in right-to-left (RTL) languages such as Arabic and Hebrew.
Console warn on empty ref, support for strings for Key Event names
[2.0.2]
Added
- Console warning when passing an empty
reftouseFocusable - Support for string names for Key Events. Now you can configure the key map with numbers or event names like
ArrowRight.
Restoring focus to the parent with `preferredChildFocusKey` set
[2.0.1]
Fixed
- Restoring focus to the parent with
preferredChildFocusKeyset