From 7871b34c6025ca6aec18bc975b5ca76ffd466d85 Mon Sep 17 00:00:00 2001 From: Dennis Postma Date: Thu, 14 Nov 2024 22:28:10 +0100 Subject: [PATCH] Don't open GM panel if focus is on any input or textarea --- src/App.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/App.vue b/src/App.vue index 6d798fd..bce1165 100644 --- a/src/App.vue +++ b/src/App.vue @@ -49,8 +49,8 @@ addEventListener('click', (event) => { addEventListener('keydown', (event) => { if (gameStore.character?.role !== 'gm') return // Only allow toggling the gm panel if the character is a gm - // Check if no input is active - if (event.repeat || event.isComposing || event.defaultPrevented) return + // Check if no input is active or focus is on an input + if (event.repeat || event.isComposing || event.defaultPrevented || document.activeElement?.tagName.toUpperCase() === 'INPUT' || document.activeElement?.tagName.toUpperCase() === 'TEXTAREA') return if (event.key === 'G') { gameStore.toggleGmPanel()