Open Dulatto opened 8 months ago
Try putting {enableOnFormTags: true}
in the third argument.
I tried like: useHotkeys('shift+n', () => console.log('shift + n pressed'), { enableOnTags: ['INPUT'], enableOnFormTags: true });
,
and still can get console message in any places of screen. I even tried : useHotkeys('shift+n', () => console.log('shift + n pressed'), { enableOnTags: ['INPUT'] }, { enableOnFormTags: true });
to avoid the misunderstanding :)
Hello, Please check the code below. What am I doing wrong or missing?
useHotkeys('shift+n', () => console.log('shift + n pressed'), { enableOnTags: ['INPUT'] });
<input type='text' id='fname' name='fname' />
This is part of React component code. If the focus is outside of input the console shows the message, but not if the focus is in input. I need to show the console message when the input is in focus. Thanks.