From 00510cdb5c9316c2a4e81ae458efde0e4a8d469e Mon Sep 17 00:00:00 2001 From: Paul Neubauer Date: Fri, 16 Sep 2022 12:15:28 +0200 Subject: [PATCH 1/4] Disable keybinds for input and textarea --- .../web-app-files/src/components/FilesList/KeyboardActions.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/web-app-files/src/components/FilesList/KeyboardActions.vue b/packages/web-app-files/src/components/FilesList/KeyboardActions.vue index 4dbcba64c16..0781b200d3e 100644 --- a/packages/web-app-files/src/components/FilesList/KeyboardActions.vue +++ b/packages/web-app-files/src/components/FilesList/KeyboardActions.vue @@ -86,6 +86,8 @@ export default defineComponent({ }), areCustomKeyBindingsEnabled() { + const activeElementTag = document.activeElement.tagName + if(activeElementTag.toLowerCase() === 'textarea' || activeElementTag.toLowerCase() === 'input') return true const closestSelectionEl = window.getSelection().focusNode as HTMLElement if (!closestSelectionEl) return false let customKeyBindings From 6c16aab5c0a67dec37f9aab8c130d0748ba01bef Mon Sep 17 00:00:00 2001 From: Paul Neubauer Date: Fri, 16 Sep 2022 12:17:46 +0200 Subject: [PATCH 2/4] Linting --- .../src/components/FilesList/KeyboardActions.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/web-app-files/src/components/FilesList/KeyboardActions.vue b/packages/web-app-files/src/components/FilesList/KeyboardActions.vue index 0781b200d3e..0ffadf493ef 100644 --- a/packages/web-app-files/src/components/FilesList/KeyboardActions.vue +++ b/packages/web-app-files/src/components/FilesList/KeyboardActions.vue @@ -87,7 +87,11 @@ export default defineComponent({ areCustomKeyBindingsEnabled() { const activeElementTag = document.activeElement.tagName - if(activeElementTag.toLowerCase() === 'textarea' || activeElementTag.toLowerCase() === 'input') return true + if ( + activeElementTag.toLowerCase() === 'textarea' || + activeElementTag.toLowerCase() === 'input' + ) + return true const closestSelectionEl = window.getSelection().focusNode as HTMLElement if (!closestSelectionEl) return false let customKeyBindings From b1f791f948b665342d71114be51a2e69451275b2 Mon Sep 17 00:00:00 2001 From: Paul Neubauer Date: Fri, 16 Sep 2022 12:18:34 +0200 Subject: [PATCH 3/4] Add PR to changelog --- changelog/unreleased/enhancement-make-keybindings-global | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog/unreleased/enhancement-make-keybindings-global b/changelog/unreleased/enhancement-make-keybindings-global index 3c1db22935c..e9663a4a26a 100644 --- a/changelog/unreleased/enhancement-make-keybindings-global +++ b/changelog/unreleased/enhancement-make-keybindings-global @@ -3,3 +3,4 @@ Enhancement: Make keybindings global We've made keybindings global and introduced a data-attribute to mark elements that need custom keybindings https://github.com/owncloud/web/pull/7569 +https://github.com/owncloud/web/pull/7648 \ No newline at end of file From 3a180b56e9662eb16525bf696a8baf3e81af688b Mon Sep 17 00:00:00 2001 From: Paul Neubauer Date: Fri, 16 Sep 2022 13:14:04 +0200 Subject: [PATCH 4/4] Disable keybinds for input and textarea --- .../src/components/FilesList/KeyboardActions.vue | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/web-app-files/src/components/FilesList/KeyboardActions.vue b/packages/web-app-files/src/components/FilesList/KeyboardActions.vue index 0ffadf493ef..55dab36a447 100644 --- a/packages/web-app-files/src/components/FilesList/KeyboardActions.vue +++ b/packages/web-app-files/src/components/FilesList/KeyboardActions.vue @@ -87,11 +87,7 @@ export default defineComponent({ areCustomKeyBindingsEnabled() { const activeElementTag = document.activeElement.tagName - if ( - activeElementTag.toLowerCase() === 'textarea' || - activeElementTag.toLowerCase() === 'input' - ) - return true + if (['textarea', 'input', 'select'].includes(activeElementTag.toLowerCase())) return true const closestSelectionEl = window.getSelection().focusNode as HTMLElement if (!closestSelectionEl) return false let customKeyBindings