glortho / glortho/react-keydown
Feature request: add @keyup and @keyupScoped decorators
Open
enhancement
- Dominant language
- JavaScript
- Stars
- 495
- Forks
- 34
- PR merge metrics
- No merged PRs in 30d
Description
In my use case, I’d like to be able to toggle state based on if a modifier key is pressed, so it would be great to be able to do something like:
```
class MyComponent extends React.Component {
@keydown('alt')
setModeCopy(event) {
this.setState({ mode: 'copy' });
}
@keyup('alt')
setModeMove(event) {
this.setState({ mode: 'move' });
}
}
```
In actually use, I think I would use @keydownScoped and @keyupScoped.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.