react-keyboard-shortcuts icon indicating copy to clipboard operation
react-keyboard-shortcuts copied to clipboard

Updating keyboard shortcuts

Open pietrop opened this issue 6 years ago • 1 comments

Hello, Thanks for the great module!

I was wondering if there's a way to change the keyboard shortcuts after the component has been initialised.

For example, use cases where you would want to give the users the possibility to customise and set their own shortcuts?

Was wondering whether this is already possible and I missed it, or if it is not what would be the best way to add support for it, I'd be happy to do a PR if it's of interest

pietrop avatar Nov 12 '18 12:11 pietrop

Thanks is a good use case. At the moment it only connects hotkeys on component mount so you would have unmount and remount the component to get it to change hotkey bindings. If we also exposed a non HOC version then we could do the logic on props and if the hotkeys updated, update the underline mousetrap. I think it is of interest. PR welcome.

CurtisHumphrey avatar Jan 08 '19 17:01 CurtisHumphrey