Skip to content

Commit

Permalink
using lamda function and removing event listener
Browse files Browse the repository at this point in the history
  • Loading branch information
bsbimalbose authored Aug 20, 2019
1 parent bdf9bfe commit b156772
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/DataSheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export default class DataSheet extends PureComponent {
document.removeEventListener('cut', this.handleCut)
document.removeEventListener('copy', this.handleCopy)
document.removeEventListener('paste', this.handlePaste)
document.removeEventListener('keydown', this.handlePaste)
}

componentDidMount () {
Expand Down Expand Up @@ -415,10 +416,9 @@ export default class DataSheet extends PureComponent {
var isIE = /MSIE|Trident/.test(ua)
// Listen for Ctrl + V in case of IE
if (isIE) {
var thisContext = this
document.addEventListener('keydown', function (e){
document.addEventListener('keydown', (e) => {
if ( (e.keyCode === 86 || e.which === 86) && e.ctrlKey){
thisContext.handlePaste(e)
this.handlePaste(e)
}
});
}
Expand Down

0 comments on commit b156772

Please sign in to comment.