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

Commit

Permalink
Added missing ref to component for native mode on create/update
Browse files Browse the repository at this point in the history
  • Loading branch information
asgvard committed Aug 21, 2019
1 parent 0327274 commit 602d781
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 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.8.3]
### Fixed
- Fixed missing reference to a component in native mode

## [2.8.2]
### Added
- Added guard checks for Enter press and Arrow press to check whether component exists
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.8.2",
"version": "2.8.3",
"description": "HOC-based Spatial Navigation (key navigation) solution for React",
"main": "dist/index.js",
"files": [
Expand Down
4 changes: 2 additions & 2 deletions src/withFocusable.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const withFocusable = ({
focusable = true
} = this.props;

const node = SpatialNavigation.isNativeMode() ? null : findDOMNode(this);
const node = SpatialNavigation.isNativeMode() ? this : findDOMNode(this);

SpatialNavigation.addFocusable({
focusKey,
Expand All @@ -125,7 +125,7 @@ const withFocusable = ({
focused, realFocusKey: focusKey, onBecameFocusedHandler, preferredChildFocusKey, focusable = true
} = this.props;

const node = SpatialNavigation.isNativeMode() ? null : findDOMNode(this);
const node = SpatialNavigation.isNativeMode() ? this : findDOMNode(this);

SpatialNavigation.updateFocusable(focusKey, {
node,
Expand Down

0 comments on commit 602d781

Please sign in to comment.