Manage elements focus by hotkey.
npm install -S @jswork/next-hotkey-focus
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!');
}
})
})
Code released under the MIT license.