@jswork/next-hotkey-focus
v1.0.4
Published
Manage elements focus by hotkey.
Downloads
10
Maintainers
Readme
next-hotkey-focus
Manage elements focus by hotkey.
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.