forked from noxious/client
Don't open GM panel if focus is on any input or textarea
This commit is contained in:
parent
85d64f23eb
commit
7871b34c60
@ -49,8 +49,8 @@ addEventListener('click', (event) => {
|
|||||||
addEventListener('keydown', (event) => {
|
addEventListener('keydown', (event) => {
|
||||||
if (gameStore.character?.role !== 'gm') return // Only allow toggling the gm panel if the character is a gm
|
if (gameStore.character?.role !== 'gm') return // Only allow toggling the gm panel if the character is a gm
|
||||||
|
|
||||||
// Check if no input is active
|
// Check if no input is active or focus is on an input
|
||||||
if (event.repeat || event.isComposing || event.defaultPrevented) return
|
if (event.repeat || event.isComposing || event.defaultPrevented || document.activeElement?.tagName.toUpperCase() === 'INPUT' || document.activeElement?.tagName.toUpperCase() === 'TEXTAREA') return
|
||||||
|
|
||||||
if (event.key === 'G') {
|
if (event.key === 'G') {
|
||||||
gameStore.toggleGmPanel()
|
gameStore.toggleGmPanel()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user