After upgrading to 3.5.0 propagating event is broken
See original GitHub issueI have an HTML element handler from which I am stopping event from bubbling up. Depsite of that hotkeys stills catches up the event handling and executes its callback.
3.4.4
does not have this issue.
Some code.
<Editor
autoCorrect={false}
autoFocus={false}
id={key}
onChange={onChangeWithKey}
onDrop={onDrop}
onKeyDown={onKeyDown}
renderNode={renderNode}
spellCheck={false}
value={editor}
/>
const onKeyDown = (event, editor, next) => {
// key down + shift
if (
event.keyCode === 40 &&
hotkeys.isPressed('shift')
) {
editor.deselect();
console.log('PREVENTING');
event.preventDefault();
event.stopPropagation();
onSelectionInitDown({ key });
return false;
}
return next();
};
useHotkeys('shift+down', (evn, handler) => {
dispatch({
type: 'SELECTION_MOVE_DOWN'
});
});
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
How to prevent hotkey to trigger event again and again if key ...
How to prevent hotkey to trigger event again and again if key is pressed? #57 ... After upgrading to 3.5.0 propagating event is...
Read more >How to prevent hotkey to trigger event again and again if key is ...
If I keep holding ctrl+s, this event keep getting fired, Is there a way to stop that? ... After upgrading to 3.5.0 propagating...
Read more >Known Issues | Cribl Docs
Problem: After upgrading a distributed deployment to Cribl Stream 3.3.x or 3.4.0, Collector jobs that use features introduced in the new version might...
Read more >event.stopImmediatePropagation() | jQuery API Documentation
Since the .live() method handles events once they have propagated to the top of the ... <script src="https://code.jquery.com/jquery-3.5.0.js"></script>.
Read more >Tesira release notes - Biamp Cornerstone
After upgrading a system to Tesira 4.4.0, existing TEC-X 1000 and ... issue with TEC-X controls not working with Tesira 4.3.0 firmware.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@peernohell thx! problem solved. Please to
hotkeys-js@3.5.1
to gitve it a try.https://codepen.io/jaywcjlove/pen/XGGWzQ
Nice try! But, except if I didn’t understand your code here https://github.com/jaywcjlove/hotkeys/blob/master/src/main.js#L247, it’s default to false so if you just change the version of hotkeys in the exemple it should have the default behevior and should not send keydown and keyup. Also, if you try to change the binding to add the option
{ keyup: false }
it’s didn’t change anything and continue to send both event keyup and keydown. In doubt I have also try to set it to true but it didn’t change anything. You can take a look to this codepen https://codepen.io/peernohell/pen/BbMegQ?editors=1111