elm / compiler

Compiler for Elm, a functional language for reliable webapps.
https://elm-lang.org/
BSD 3-Clause "New" or "Revised" License
7.53k stars 663 forks source link

There's no way to instruct Elm to override the default handling of the backspace key #482

Closed tathougies closed 9 years ago

tathougies commented 10 years ago

Some applications may want to handle the backspace key, rather than let the browser do the default behavior (go to the last page). There should be some way for applications to tell Elm that they want to capture the backspace key.

Javascript-wise, this would involve calling preventDefault on the event object.

avh4 commented 10 years ago

preventDefault will also be desired for other keys, like up/down/left/right, spacebar, and others

wetmore commented 9 years ago

+1. This would be very useful.

evancz commented 9 years ago

You can do this kind of stuff with elm-html now, so that'd be the recommended route for now.

If you need to do it another way, please open an issue on https://github.com/elm-lang/core/issues describing your particular use case (i.e. what your architecture is and what your project is)