1.0.4 • Published 3 years ago

@jswork/next-hotkey-focus v1.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

next-hotkey-focus

Manage elements focus by hotkey.

version license size download

installation

npm install -S @jswork/next-hotkey-focus

usage

import '@jswork/next-hotkey-focus';

// Make sure selector elements are loaded.
window.addEventListener("DOMContentLoaded", () => {
  nx.hotkeyFocus({
    keys: ['cmd + k'], 
    selectors: ['input[data-hotkey-focus]'],
    callback: (e) => {
      console.log('focued!');
    }
  })
})

license

Code released under the MIT license.