react-hotkeys icon indicating copy to clipboard operation
react-hotkeys copied to clipboard

cmd+c triggers action bound to c even when allowCombinationSubmatches is false [BUG]

Open jiemeechong801 opened this issue 3 years ago • 3 comments

Describe the bug I have an action bound to c but cmd+c seems to trigger the action regardless what allowCombinationSubmatches is set to. There is no action bound to cmd+c in my code.

How are you using react hotkeys components? (HotKeys, GlobalHotKeys, IgnoreKeys etc) GlobalHotKeys is used in my component.

Expected behavior Pressing cmd+c does not trigger the action bound to c.

Platform (please complete the following information):

  • Version of react-hotkeys: 2.0.0-pre9
  • Browser - chrome

What Configuration options are you using? I am using the default configuration.

jiemeechong801 avatar Nov 25 '20 05:11 jiemeechong801

@jiemeechong801 fixed a related bug -- does it reproduce on my fork? https://github.com/ibash/react-hotkeys/commit/23c363b901aeb1765be31f04039a4123b567baa2

ibash avatar Mar 07 '21 20:03 ibash

@jiemeechong801 fixed a related bug -- does it reproduce on my fork? ibash@23c363b

I tried your fork, I have the "r" key registered and on osx, when pressing cmd+r, the action associated to the "r" key is triggered anyway

joepsyko avatar Mar 28 '21 08:03 joepsyko

I could as well reproduce it with the cmd+enter. With both this and react-hotkeys-ce package. In my case, the child component consumes the cmd+enter event with its enter handler and the parent component that should react to cmd+enter will never get a chance. It would be nice if we could at least specify the stopEventPropagationAfterHandling option locally.

radoslavkarlik avatar Apr 12 '21 12:04 radoslavkarlik