Skip to content
This repository has been archived by the owner on Aug 23, 2018. It is now read-only.

Handling preventDefault #2

Open
mdgriffith opened this issue May 20, 2016 · 2 comments
Open

Handling preventDefault #2

mdgriffith opened this issue May 20, 2016 · 2 comments

Comments

@mdgriffith
Copy link

I have a project which uses spacebar and backspace as controls, both of which have builtin defaults in the browser that I need to bypass.

Being able to selectively preventDefault on a key-by-key basis would be ideal or in some cases to preventDefault on a conditional basis within elm. e.g. Only preventDefault for a key if the model has a certain state. However at the moment my app doesn't require the latter.

@akbiggs
Copy link

akbiggs commented Jun 7, 2016

This would be really useful for game development in Elm, since most in-browser games will use keys with default behaviours such as the arrow keys and the spacebar.

@Emilios1995
Copy link

@mdgriffith In the meantime you can use Chrome Canary, which no longer have the default behaviour for backspace. This is expected to be shipped in future versions of Chrome.

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

No branches or pull requests

3 participants