question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

After upgrading to 3.5.0 propagating event is broken

See original GitHub issue

I 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:open
  • Created 4 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
jaywcjlovecommented, Mar 25, 2019

@peernohell thx! problem solved. Please to hotkeys-js@3.5.1 to gitve it a try.

https://codepen.io/jaywcjlove/pen/XGGWzQ

0reactions
peernohellcommented, Mar 24, 2019

@peernohell This is a new feature. #57

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found