Skip to content

Commit 541634d

Browse files
authored
Replaced Reflect.deleteProperty by delete (#51)
* Replaced reflect by delete * bump package lock
1 parent 10fe198 commit 541634d

4 files changed

Lines changed: 9 additions & 5 deletions

File tree

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+
# [1.1.3]
8+
## Changed
9+
- `Reflect.deleteProperty` was replaced by `delete` to be es5 compliant.
10+
711
# [1.1.2]
812
## Added
913
- Param `focusDetails` in `focusSelf` and `setFocus` methods.

package-lock.json

Lines changed: 2 additions & 2 deletions
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/norigin-spatial-navigation",
3-
"version": "1.1.2",
3+
"version": "1.1.3",
44
"description": "React hooks based Spatial Navigation solution",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

src/SpatialNavigation.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ class SpatialNavigationService {
676676
this.keyUpEventListener = (event: KeyboardEvent) => {
677677
const eventType = this.getEventType(event.keyCode);
678678

679-
Reflect.deleteProperty(this.pressedKeys, eventType);
679+
delete this.pressedKeys[eventType];
680680

681681
if (this.throttle && !this.throttleKeypresses) {
682682
this.keyDownEventListenerThrottled.cancel();
@@ -1141,7 +1141,7 @@ class SpatialNavigationService {
11411141
if (componentToRemove) {
11421142
const { parentFocusKey } = componentToRemove;
11431143

1144-
Reflect.deleteProperty(this.focusableComponents, focusKey);
1144+
delete this.focusableComponents[focusKey];
11451145

11461146
const parentComponent = this.focusableComponents[parentFocusKey];
11471147
const isFocused = focusKey === this.focusKey;

0 commit comments

Comments
 (0)