This is an automated email from the ASF dual-hosted git repository.

justinpark pushed a commit to branch sqllab-custom-result-table
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/sqllab-custom-result-table by 
this push:
     new ab0710a305 Fix unbind bug
ab0710a305 is described below

commit ab0710a305007a6fa122571604edad8509410968
Author: justinpark <[email protected]>
AuthorDate: Wed Sep 27 18:32:15 2023 -0700

    Fix unbind bug
---
 superset-frontend/src/SqlLab/components/SqlEditor/index.jsx | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/superset-frontend/src/SqlLab/components/SqlEditor/index.jsx 
b/superset-frontend/src/SqlLab/components/SqlEditor/index.jsx
index cda252f1e3..da89007b7a 100644
--- a/superset-frontend/src/SqlLab/components/SqlEditor/index.jsx
+++ b/superset-frontend/src/SqlLab/components/SqlEditor/index.jsx
@@ -461,11 +461,15 @@ const SqlEditor = ({
 
   useEffect(() => {
     // setup hotkeys
-    Mousetrap.reset();
     const hotkeys = getHotkeyConfig();
     hotkeys.forEach(keyConfig => {
       Mousetrap.bind([keyConfig.key], keyConfig.func);
     });
+    return () => {
+      hotkeys.forEach(keyConfig => {
+        Mousetrap.unbind(keyConfig.key);
+      });
+    };
   }, [getHotkeyConfig, latestQuery]);
 
   const onResizeStart = () => {

Reply via email to