Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use keyboard shortcut after moving layer (Firefox) #346

Closed
juliandescottes opened this issue Nov 30, 2015 · 2 comments
Closed

Cannot use keyboard shortcut after moving layer (Firefox) #346

juliandescottes opened this issue Nov 30, 2015 · 2 comments
Labels
Milestone

Comments

@juliandescottes
Copy link
Collaborator

Firefox only !

Steps to reproduce :

  • open Piskel in Firefox
  • create a sprite (pen tool should be selected by default)
  • click on "create layer"
  • click on "move layer down"
  • press "S"

Expected : the Rectangle selection tool should be selected
Actual : the Pen tool is still selected

After clicking anywhere else on the page, the keyboard shortcut will work again.

@captainbrosset
Copy link
Contributor

I investigated this a little bit.
When the key is pressed, the ShortcutService's keydown handler isn't even called.

I thought this was because the button was focused after being clicked and was consuming the event. But if you try with a slider for example (an input range, there are a couple in the right hand-side drawer), then even when it's focused, the event still bubbles up to the window.

I found out that if you create more than 2 layers, then it works fine after clicking the move layer down button just once. So I think this has something to do with the fact that the button is disabled:

after you press "move layer down", the new layer you created becomes the bottom-most one, and so the button gets disabled. And it seems that on Firefox, when a disabled button has focus, then all keydown events are consumed and lost.

So one way to fix this is blurring the button right before disabling it.

@juliandescottes
Copy link
Collaborator Author

Will close issue when included in a release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants