(el: Element | null)
| 98 | useEffect(() => { |
| 99 | let isMac = /Mac/.test(navigator.platform); |
| 100 | const isTextInputLike = (el: Element | null): boolean => { |
| 101 | if (!el) { |
| 102 | return false; |
| 103 | } |
| 104 | let h = el as HTMLElement; |
| 105 | return ( |
| 106 | h.isContentEditable || !!el.closest('input, textarea, [contenteditable], [role="textbox"]') |
| 107 | ); |
| 108 | }; |
| 109 | |
| 110 | const handleKeyDown = (e: KeyboardEvent) => { |
| 111 | if (e.isComposing) { |