1
0
forked from noxious/client

Don't open GM panel if focus is on any input or textarea

This commit is contained in:
Dennis Postma 2024-11-14 22:28:10 +01:00
parent 85d64f23eb
commit 7871b34c60

View File

@ -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()