Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

Commit

Permalink
Exposed updateAllSpatialLayouts (#81)
Browse files Browse the repository at this point in the history
* Exposed updateAllSpatialLayouts

* typo
  • Loading branch information
guilleccc authored Feb 1, 2021
1 parent c625b54 commit a96f924
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.12.6]
### Added
- Added `updateAllSpatialLayouts` to allow updating components layout at any time that is required.

## [2.12.5]
### Added
- Added `blockNavigationOut` to avoid focus out from the selected component.
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,9 @@ This function pauses key listeners. Useful when you need to temporary disable na
### `resumeSpatialNavigation`: function
This function resumes key listeners if it was paused with [pauseSpatialNavigation](#pauseSpatialNavigation-function)

### `updateAllSpatialLayouts`: function
This function update all components layouts. It can be used before setFocus is invoked, when the layouts have changed without being noticed by spatialNavigation service.

### Data Types

### `KeyDetails`: object
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@noriginmedia/react-spatial-navigation",
"version": "2.12.5",
"version": "2.12.6",
"description": "HOC-based Spatial Navigation (key navigation) solution for React",
"main": "dist/index.js",
"files": [
Expand Down
1 change: 1 addition & 0 deletions src/spatialNavigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ class SpatialNavigation {
this.pause = this.pause.bind(this);
this.resume = this.resume.bind(this);
this.setFocus = this.setFocus.bind(this);
this.updateAllLayouts = this.updateAllLayouts.bind(this);
this.navigateByDirection = this.navigateByDirection.bind(this);
this.init = this.init.bind(this);
this.setKeyMap = this.setKeyMap.bind(this);
Expand Down
3 changes: 2 additions & 1 deletion src/withFocusable.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ const withFocusable = ({
onBecameBlurred(layout, rest, details);
},
pauseSpatialNavigation: () => SpatialNavigation.pause,
resumeSpatialNavigation: () => SpatialNavigation.resume
resumeSpatialNavigation: () => SpatialNavigation.resume,
updateAllSpatialLayouts: () => SpatialNavigation.updateAllLayouts
}),

lifecycle({
Expand Down

0 comments on commit a96f924

Please sign in to comment.