hotkey
hotkey copied to clipboard
Don't call preventDefault() if the hotkey-fire event has been cancelled
We've ran into the issue that hotkeys are still triggered if the element is not clickable/accessible. In our case the button is covered by the scrim of a dialog.
We use the hotkey-fire event to call preventDefault() on the hotkey event, but we want the original key event to still go through. This currently doesn't work as this library always calls preventDefault after firing the hotkey-fire event, even if the hotkey-fire event is cancelled.
This PR changes this behaviour to no longer prevent the key event if hotkey-fire event is cancelled.