From b106facec53b0ee2c74e44672722f02e9c7b9267 Mon Sep 17 00:00:00 2001 From: Uri Shaked Date: Sun, 3 Jan 2021 15:47:21 +0200 Subject: [PATCH] Bugfix: onKeyDown() called instead of onKeyUp() `onKeyDown()` is called both on key down and key up events, and `onKeyUp()` is never called... --- src/PanZoom.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/PanZoom.js b/src/PanZoom.js index 9987e46..b14aafd 100644 --- a/src/PanZoom.js +++ b/src/PanZoom.js @@ -297,10 +297,10 @@ class PanZoom extends React.Component { } onKeyUp = (e: SyntheticKeyboardEvent) => { - const { disableKeyInteraction, onKeyDown } = this.props + const { disableKeyInteraction, onKeyUp } = this.props - if (typeof onKeyDown === 'function') { - onKeyDown(e) + if (typeof onKeyUp === 'function') { + onKeyUp(e) } if (disableKeyInteraction) {