jaywcjlove / hotkeys-js

➷ A robust Javascript library for capturing keyboard input. It has no dependencies.
https://jaywcjlove.github.io/hotkeys-js
MIT License
6.66k stars 410 forks source link

fix: Fix problem with element scope #352

Closed zhaokun1219 closed 2 years ago

zhaokun1219 commented 2 years ago
  1. Fix the problem of element scope. Shortcut keys only take effect on specific elements
  2. The default element option is document, but the test case named "unbind with method test" passes document.body triggers the event, which will bubble on the document. Previously, the callback was called twice (one triggered by document.body and one triggered by document). But now we have fixed the bug in the element scope, so the callback will only be called once
  3. The default timeout of a hook in "jest" is 30s, but the startup time of "puppeter" is too long, which leads to an error when the execution time of "beforeAll" hook exceeds 30 seconds occasionally, so the timeout of "beforeAll" is extended
zhaokun1219 commented 2 years ago

This solves the issue #247

jaywcjlove commented 2 years ago

@zhaokun1219 thx!