Matteas-Eden / roll-for-reaction

An extension of react-rpg inspired by DnD 5e
https://matteas.nz/roll-for-reaction
MIT License
7 stars 3 forks source link

Pressing Spacebar/Enter Sometimes Causes a Different Menu to Open #328

Open Pyxxil opened 4 years ago

Pyxxil commented 4 years ago

Bug Summary Sometimes when the user has clicked on a button with their mouse, this will cause the button to become focussed. In these scenarios when they then go to press space/enter it will cause that button to be clicked again.


Expected behavior I would expect the hotkeys to do as they're supposed to.

Observed Behaviour Sometimes when attacking the player will accidentally open a dialog instead.

Steps To Reproduce

  1. Click on a button in the UI
  2. Close that dialog with ESC
  3. Press Space/Enter

Environment

Additional context This is probably caused by the browsers focussing mechanics, and may be possible to remove by removing the ability to focus on specific items, or by making other things autofocussed.