feat(useKeyPress): add additional check for nokey classname to support custom inputs closes #2254
This commit is contained in:
@@ -110,5 +110,9 @@ function useKeyOrCode(eventCode: string, keysToWatch: KeyCode): KeyOrCode {
|
||||
function isInputDOMNode(event: KeyboardEvent): boolean {
|
||||
const target = event.target as HTMLElement;
|
||||
|
||||
return ['INPUT', 'SELECT', 'TEXTAREA'].includes(target?.nodeName) || target?.hasAttribute('contenteditable');
|
||||
return (
|
||||
['INPUT', 'SELECT', 'TEXTAREA'].includes(target?.nodeName) ||
|
||||
target?.hasAttribute('contenteditable') ||
|
||||
!!target?.closest('.nokey')
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user