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

Global events are called parent first

Open greena13 opened this issue 8 years ago • 0 comments

Very similar to #56, if two <Shortcut /> tags with the global prop are rendered, one as the child of the other, and they both bind to the same keys, the parent's handler is called before the childs. This is despite the child <Shortcut /> tag being closer to the event target.

IMHO, this is not what people will expect. Users of react and front event developers are accustomed to event handlers defined closer to the target of an event being called first (and being given the chance to stop that event from propagating to handlers attached to parent elements).

greena13 avatar Oct 23 '17 07:10 greena13