(e: KeyboardEvent)
| 19 | |
| 20 | // Useful for avoiding capturing keyboard shortcuts and text entry. |
| 21 | export function isLegitKeypress(e: KeyboardEvent) { |
| 22 | const target = e.target as Element; |
| 23 | if ( |
| 24 | e.ctrlKey || |
| 25 | e.altKey || |
| 26 | e.metaKey || |
| 27 | target.tagName.toLowerCase() == 'input' || |
| 28 | target.tagName.toLowerCase() == 'textarea' |
| 29 | ) { |
| 30 | return false; |
| 31 | } |
| 32 | return true; |
| 33 | } |
no outgoing calls
no test coverage detected