Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@noriginmedia/react-spatial-navigation

Package Overview
Dependencies
Maintainers
2
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@noriginmedia/react-spatial-navigation - npm Package Compare versions

Comparing version 2.11.0 to 2.12.0

4

CHANGELOG.md

@@ -7,2 +7,6 @@ # Changelog

## [2.12.0]
### Added
- added `autoRestoreFocus` prop to control whether parent component should restore focus on any available child when a currently focused child component is unmounted.
## [2.11.0]

@@ -9,0 +13,0 @@ ### Changed

4

dist/spatialNavigation.js

@@ -786,2 +786,3 @@ 'use strict';

preferredChildFocusKey = _ref3.preferredChildFocusKey,
autoRestoreFocus = _ref3.autoRestoreFocus,
focusable = _ref3.focusable;

@@ -804,2 +805,3 @@

focusable: focusable,
autoRestoreFocus: autoRestoreFocus,
layout: {

@@ -862,3 +864,3 @@ x: 0,

*/
if (isFocused) {
if (isFocused && parentComponent.autoRestoreFocus) {
this.setFocus(parentFocusKey);

@@ -865,0 +867,0 @@ }

@@ -77,3 +77,4 @@ 'use strict';

_ref$trackChildren = _ref.trackChildren,
configTrackChildren = _ref$trackChildren === undefined ? false : _ref$trackChildren;
configTrackChildren = _ref$trackChildren === undefined ? false : _ref$trackChildren,
configAutoRestoreFocus = _ref.autoRestoreFocus;

@@ -199,3 +200,5 @@ return (0, _compose2.default)((0, _getContext2.default)({

_props$focusable = _props.focusable,
focusable = _props$focusable === undefined ? true : _props$focusable;
focusable = _props$focusable === undefined ? true : _props$focusable,
_props$autoRestoreFoc = _props.autoRestoreFocus,
autoRestoreFocus = _props$autoRestoreFoc === undefined ? true : _props$autoRestoreFoc;

@@ -218,2 +221,3 @@

trackChildren: configTrackChildren || trackChildren,
autoRestoreFocus: configAutoRestoreFocus !== undefined ? configAutoRestoreFocus : autoRestoreFocus,
focusable: focusable

@@ -246,5 +250,5 @@ });

}
}), _pure2.default, omitProps(['onBecameFocusedHandler', 'onBecameBlurredHandler', 'onEnterPressHandler', 'onArrowPressHandler', 'onUpdateFocus', 'onUpdateHasFocusedChild', 'forgetLastFocusedChild', 'trackChildren']));
}), _pure2.default, omitProps(['onBecameFocusedHandler', 'onBecameBlurredHandler', 'onEnterPressHandler', 'onArrowPressHandler', 'onUpdateFocus', 'onUpdateHasFocusedChild', 'forgetLastFocusedChild', 'trackChildren', 'autoRestoreFocus']));
};
exports.default = withFocusable;
{
"name": "@noriginmedia/react-spatial-navigation",
"version": "2.11.0",
"version": "2.12.0",
"description": "HOC-based Spatial Navigation (key navigation) solution for React",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -90,2 +90,3 @@ # react-spatial-navigation

onBecameBlurred={props.onItemBlurred}
autoRestoreFocus={false}
/>

@@ -240,2 +241,7 @@ ...

##### `autoRestoreFocus`: boolean
To determine whether parent component should focus the first available child component when currently focused child is unmounted.
* **true (default)**
* **false**
## Props that can be applied to HOC

@@ -250,2 +256,5 @@ All these props are optional.

### `autoRestoreFocus`: boolean
Same as in [config](#config).
### `focusable`: boolean

@@ -252,0 +261,0 @@ Determine whether this component should be focusable (in other words, whether it's *currently* participating in the spatial navigation tree). This allows a focusable component to be ignored as a navigation target despite being mounted (e.g. due to being off-screen, hidden, or temporarily disabled).

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc