(e: KeyboardEvent)
| 108 | }; |
| 109 | |
| 110 | const handleKeyDown = (e: KeyboardEvent) => { |
| 111 | if (e.isComposing) { |
| 112 | // avoid intercepting IME input |
| 113 | return; |
| 114 | } |
| 115 | |
| 116 | if (e.key === 'Escape' && isSearchOpen) { |
| 117 | e.preventDefault(); |
| 118 | onClose(); |
| 119 | } else if (e.key === 'k' && (isMac ? e.metaKey : e.ctrlKey)) { |
| 120 | e.preventDefault(); |
| 121 | open(''); |
| 122 | } else if ( |
| 123 | e.key === '/' && |
| 124 | !(isTextInputLike(e.target as Element | null) || isTextInputLike(getActiveElement())) |
| 125 | ) { |
| 126 | e.preventDefault(); |
| 127 | open(''); |
| 128 | } |
| 129 | }; |
| 130 | |
| 131 | let handleCustomEvent = () => { |
| 132 | open(''); |
nothing calls this directly
no test coverage detected