-
Couldn't load subscription status.
- Fork 7
Open
Description
Hi,
Nice project, but I found something while using it that could be optimized.
In your code you can pass the event object like this:
onKeyDown: (e) => {
if (e.keyCode === 37){
if(ArrowKeysReact._config.hasOwnProperty('left')){
ArrowKeysReact._config.left(e);
}
}
...
This way, a user can accept this as a parameter in his config and use it if and when necessary like this:
ArrowKeysReact.config({
left: (e) => {
e.preventDefault();
...other stuff
},
If you want I can make a pull request for you to review.
Best regards
Metadata
Metadata
Assignees
Labels
No labels