react-keybindings
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -145,3 +145,3 @@ "use strict"; | ||
}, | ||
keyActions: (0, _keyActions2.default)(this.state.pressedKeys) | ||
keyActions: (0, _keyActions2.default)(keymap, this.state.pressedKeys) | ||
}, this.state, this.props)); | ||
@@ -148,0 +148,0 @@ } |
@@ -10,3 +10,3 @@ "use strict"; | ||
exports.default = function (pressedKeys) { | ||
exports.default = function (keymap, pressedKeys) { | ||
if (pressedKeys.length > 0) { | ||
@@ -13,0 +13,0 @@ return Object.keys(keymap).filter(function (action) { |
{ | ||
"name": "react-keybindings", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "Add keybindings in React apps", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
@@ -97,3 +97,3 @@ import React, { Component } from "react" | ||
ref={ (wrapped) => this.wrapped = wrapped } | ||
keyActions={ keyActions(this.state.pressedKeys) } | ||
keyActions={ keyActions(keymap, this.state.pressedKeys) } | ||
{ ...this.state } | ||
@@ -100,0 +100,0 @@ { ...this.props } /> |
/** | ||
* Watch the pressed keys and return related actions | ||
*/ | ||
export default (pressedKeys) => { | ||
export default (keymap, pressedKeys) => { | ||
if (pressedKeys.length > 0) { | ||
@@ -6,0 +6,0 @@ return Object.keys(keymap).filter((action) => { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20284