https://github.com/devorbitus/backspace-block
Bower component to block the backspace button from working when user is not on an input field so that the browser doesn't trigger the back button
https://github.com/devorbitus/backspace-block
Last synced: 8 months ago
JSON representation
Bower component to block the backspace button from working when user is not on an input field so that the browser doesn't trigger the back button
- Host: GitHub
- URL: https://github.com/devorbitus/backspace-block
- Owner: devorbitus
- License: mit
- Created: 2014-11-20T16:19:08.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-11-21T20:39:28.000Z (over 11 years ago)
- Last Synced: 2025-10-28T02:13:32.869Z (8 months ago)
- Language: JavaScript
- Homepage:
- Size: 137 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# backspace-block
Bower component to block the backspace button from working when user is not on an input field so that the browser doesn't trigger the back button.
## Installation
### bower
```shell
bower install backspace-block
```
Then add a `` to your `index.html`:
```html
<script src="/bower_components/backspace-block/backspace-block.js">
```
## Features
After adding this project to your application the backspace key will only be registered by the browser when you are in an input field or a text area. There are no dependancies for this to function properly.
## Credits
This originated from JP Richardson's excellent library [prevent-backspace](https://github.com/jprichardson/prevent-backspace) which was written as a repackaging of an answer to [this](http://stackoverflow.com/questions/1495219/how-can-i-prevent-the-backspace-key-from-navigating-back) StackOverflow question. Prevent-backspace is very useful for anyone using browserifiy or component but I wanted it to be able to be added with bower directly, as well as adding support for blocking when on radio buttons, checkboxes, selects, and submit buttons.
## License
(MIT License)
Copyright 2014, Chris Gruel