Skip to content

Changelog

Breaking Change Changed switchArea method in Spatial Navigation to no longer focus the first element in the specified area but instead attempt to focus the last focused element in that area. If no element was previously focused in that area, or if that element has been removed from the DOM, it falls back to focusFirst(). This change allows for a more intuitive navigation experience when switching between areas.

New Added a new getLastFocused method in Spatial Navigation that returns the last focused element from a specific area.

New Added exports for both the GamepadMappings and KeyboardMappings objects to allow developers to easily access and utilize predefined action mappings in their projects.

Feature Migrated project build system to Vite for improved performance and modern tooling.

New Added Type Support & IntelliSense documentation page to help developers leverage TypeScript definitions in various project setups.

Fix Fixed an issue in Gamepad where the setter for pollingInterval didn’t update the interval function.

Feature Migrated the entire codebase to TypeScript. The library now includes native type definitions for better developer experience.

Fix Resolved timing mismatches in Gamepad by removing the gamepadconnected listener. Polling now begins explicitly when the enabled property is set to true.

Fix Gamepad actions are now triggered correctly even when combined. Callbacks for individual actions (e.g., 'pad-up') will fire even if multiple actions are executed simultaneously (e.g., 'pad-up' + 'pad-down').

Feature Added pause() and resume() methods to Spatial Navigation for temporarily disabling and re-enabling navigation actions.

Fix Fixed Spatial Navigation to only remove the navigation actions from keys instead of removing the keys entirely from the action system, preventing other registered actions or callbacks on the same keys from being broken.

Feature Added support for multiple callbacks per key combination and type in Keyboard.

Feature Added optional callback parameter to Keyboard.off() method to remove specific callbacks.

Feature Added automatic cleanup of empty keyboard entries when all callbacks are removed.

Feature Added support for multiple callbacks per action combination and type in Gamepad.

Feature Added optional callback parameter to Gamepad.off() method to remove specific callbacks.

Feature Added automatic cleanup of empty gamepad entries when all callbacks are removed.

Feature Added support for HTMLElement references in Spatial Navigation. You can now pass direct HTMLElement references in init() and add() methods.

Fix Fixed navigation area removal in Spatial Navigation to properly delete the area instead of setting it to an empty object.