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

Commit a96f924

Browse files
authored
Exposed updateAllSpatialLayouts (#81)
* Exposed updateAllSpatialLayouts * typo
1 parent c625b54 commit a96f924

File tree

6 files changed

+12
-3
lines changed

6 files changed

+12
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [2.12.6]
8+
### Added
9+
- Added `updateAllSpatialLayouts` to allow updating components layout at any time that is required.
10+
711
## [2.12.5]
812
### Added
913
- Added `blockNavigationOut` to avoid focus out from the selected component.

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,9 @@ This function pauses key listeners. Useful when you need to temporary disable na
420420
### `resumeSpatialNavigation`: function
421421
This function resumes key listeners if it was paused with [pauseSpatialNavigation](#pauseSpatialNavigation-function)
422422

423+
### `updateAllSpatialLayouts`: function
424+
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.
425+
423426
### Data Types
424427

425428
### `KeyDetails`: object

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@noriginmedia/react-spatial-navigation",
3-
"version": "2.12.5",
3+
"version": "2.12.6",
44
"description": "HOC-based Spatial Navigation (key navigation) solution for React",
55
"main": "dist/index.js",
66
"files": [

src/spatialNavigation.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ class SpatialNavigation {
309309
this.pause = this.pause.bind(this);
310310
this.resume = this.resume.bind(this);
311311
this.setFocus = this.setFocus.bind(this);
312+
this.updateAllLayouts = this.updateAllLayouts.bind(this);
312313
this.navigateByDirection = this.navigateByDirection.bind(this);
313314
this.init = this.init.bind(this);
314315
this.setKeyMap = this.setKeyMap.bind(this);

src/withFocusable.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ const withFocusable = ({
9494
onBecameBlurred(layout, rest, details);
9595
},
9696
pauseSpatialNavigation: () => SpatialNavigation.pause,
97-
resumeSpatialNavigation: () => SpatialNavigation.resume
97+
resumeSpatialNavigation: () => SpatialNavigation.resume,
98+
updateAllSpatialLayouts: () => SpatialNavigation.updateAllLayouts
9899
}),
99100

100101
lifecycle({

0 commit comments

Comments
 (0)