Skip to content

Commit 6a7e164

Browse files
authored
Issue #25 - Fix focus lost (#54)
* updated parentFocusKey when removeFocusable * Updated changelog and bump version
1 parent b9dc5e6 commit 6a7e164

3 files changed

Lines changed: 13 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ 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+
# [1.1.4]
8+
## Changed
9+
- Update `parentFocusKey` when `removeFocusable`
10+
- Fix issue with `destroy` (added `bind`)
11+
712
# [1.1.3]
813
## Changed
914
- `Reflect.deleteProperty` was replaced by `delete` to be es5 compliant.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@noriginmedia/norigin-spatial-navigation",
3-
"version": "1.1.3",
3+
"version": "1.1.4",
44
"description": "React hooks based Spatial Navigation solution",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

src/SpatialNavigation.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,6 +1158,13 @@ class SpatialNavigationService {
11581158
return;
11591159
}
11601160

1161+
forEach(this.focusableComponents, (component) => {
1162+
if (component.parentFocusKey === focusKey && component.focusable) {
1163+
// eslint-disable-next-line no-param-reassign
1164+
component.parentFocusKey = parentFocusKey;
1165+
}
1166+
});
1167+
11611168
/**
11621169
* If the component was also focused at this time, focus another one
11631170
*/

0 commit comments

Comments
 (0)