aiannacc / Goko-Salvager

Enhance your Dominion Online experience!
13 stars 9 forks source link

Possible to hit "End Turn" button by typing "Enter" #249

Open aiannacc opened 9 years ago

aiannacc commented 9 years ago

http://forum.dominionstrategy.com/index.php?topic=8163.msg423926#msg423926

Which happened was, that I was chatting in the goko-chat and pressed "Enter" to send. But it didn't press Enter for the goko-chat but for the side-log of the extension. Because a clicked "end turn" the turn before, my Enter pressed that button and so I missed the 3 Provinces.

GwinnR commented 9 years ago

I use Windows 7 and Firefox. Strange is that I could first type in the chat box (as seen in the video) and then it stopped working. Then I pressed Enter which had the described effect.

theblankman commented 9 years ago

Maybe the events didn't get processed in the right order? Say the listener that triggers the button is ahead of the listener that grabs focus for chat.

The button definitely keeps focus throughout the act of typing in the chat window, you can see the extra dashed outline around "End Turn" the whole time. Also, when he presses Enter the End Turn button fires but the chat message doesn't post. Salvager's UI elements have focus, and consume the key event.

Is the whole play area (including Goko's chat, etc) one big canvas? If so, the browser might be agnostic to what's in the canvas, and always leave focus on the UI elements it actually understands, which is the buttons and text fields that Salvager creates. The solution might just be to have those buttons pass focus elsewhere when clicked, either to the Salvager chat box if it's visible or back to Goko's canvas?

theblankman commented 9 years ago

PS This doesn't seem to happen on Chrome/MacOS. When End Turn is clicked, it becomes disabled (because it's no longer your turn), and loses focus as a result. I can try it in other environments tomorrow.