react-keybinding-component
Advanced tools
Comparing version 0.3.1 to 0.3.2
@@ -55,3 +55,3 @@ 'use strict'; | ||
value: function componentWillUnmount() { | ||
this.props.target.removeEventListener(this.props.type, this.onKey); | ||
if (typeof this.props.target === 'string') document.querySelector(this.props.target).removeEventListener(this.props.type, this.onKey);else if (_typeof(this.props.target) === 'object') this.props.target.removeEventListener(this.props.type, this.onKey); | ||
} | ||
@@ -58,0 +58,0 @@ }]); |
@@ -29,3 +29,4 @@ import React, { Component } from 'react'; | ||
componentWillUnmount() { | ||
this.props.target.removeEventListener(this.props.type, this.onKey); | ||
if(typeof this.props.target === 'string') document.querySelector(this.props.target).removeEventListener(this.props.type, this.onKey); | ||
else if(typeof this.props.target === 'object') this.props.target.removeEventListener(this.props.type, this.onKey); | ||
} | ||
@@ -32,0 +33,0 @@ } |
{ | ||
"name": "react-keybinding-component", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "A React keybinding component, usable with es6, no mixin", | ||
@@ -5,0 +5,0 @@ "main": "dist/react-keybinding-component.js", |
9711
105