prevents default behavior if shortcut executed in it is own scope #3402 (#3417)

Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
This commit is contained in:
sergeyteleshev
2025-05-08 14:43:10 +02:00
committed by GitHub
co-authored by Daria Marutkina
parent 0ae505fd32
commit 5d90858fa3
2 changed files with 4 additions and 3 deletions
@@ -1,6 +1,6 @@
/*
* CloudBeaver - Cloud Database Manager
* Copyright (C) 2020-2024 DBeaver Corp and others
* Copyright (C) 2020-2025 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.
@@ -72,8 +72,9 @@ export const CaptureView = observer<React.PropsWithChildren<ICaptureViewProps>>(
return isObjectsEqual(hotkey, handler);
});
});
const isAppliedInSelectedScope = Boolean(state.reference?.contains(document.activeElement));
return action?.binding?.binding.preventDefault === true;
return isAppliedInSelectedScope && action?.binding?.binding.preventDefault === true;
},
enableOnContentEditable: true,
},
@@ -1,6 +1,6 @@
/*
* CloudBeaver - Cloud Database Manager
* Copyright (C) 2020-2024 DBeaver Corp and others
* Copyright (C) 2020-2025 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.