From 5d90858fa333be5b4fb8180bd6ed2fa6bb949233 Mon Sep 17 00:00:00 2001 From: sergeyteleshev Date: Thu, 8 May 2025 14:43:10 +0200 Subject: [PATCH] prevents default behavior if shortcut executed in it is own scope #3402 (#3417) Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com> --- webapp/packages/core-view/src/View/CaptureView.tsx | 5 +++-- .../NavigationTreeSettings/KEY_BINDING_ENABLE_FILTER.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/webapp/packages/core-view/src/View/CaptureView.tsx b/webapp/packages/core-view/src/View/CaptureView.tsx index f675fd2e2d..52c36991d9 100644 --- a/webapp/packages/core-view/src/View/CaptureView.tsx +++ b/webapp/packages/core-view/src/View/CaptureView.tsx @@ -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>( 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, }, diff --git a/webapp/packages/plugin-navigation-tree/src/NavigationTree/ElementsTree/ElementsTreeTools/NavigationTreeSettings/KEY_BINDING_ENABLE_FILTER.ts b/webapp/packages/plugin-navigation-tree/src/NavigationTree/ElementsTree/ElementsTreeTools/NavigationTreeSettings/KEY_BINDING_ENABLE_FILTER.ts index 0c4457ba41..79ca5041ea 100644 --- a/webapp/packages/plugin-navigation-tree/src/NavigationTree/ElementsTree/ElementsTreeTools/NavigationTreeSettings/KEY_BINDING_ENABLE_FILTER.ts +++ b/webapp/packages/plugin-navigation-tree/src/NavigationTree/ElementsTree/ElementsTreeTools/NavigationTreeSettings/KEY_BINDING_ENABLE_FILTER.ts @@ -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.