(target: KeyTargetLike | null | undefined)
| 147 | * nicht nur als Folge des ersten; der Grund steht bei {@link EDITOR_SURFACE}. |
| 148 | */ |
| 149 | export function isTypingTarget(target: KeyTargetLike | null | undefined): boolean { |
| 150 | if (target === null || target === undefined) { |
| 151 | return false; |
| 152 | } |
| 153 | if (target.isContentEditable === true) { |
| 154 | return true; |
| 155 | } |
| 156 | const tag = (target.tagName ?? '').toUpperCase(); |
| 157 | if (tag === 'INPUT' || tag === 'TEXTAREA' || tag === 'SELECT') { |
| 158 | return true; |
| 159 | } |
| 160 | return target.closest?.(EDITOR_SURFACE) != null; |
| 161 | } |
| 162 | |
| 163 | /** Der Buchstabe hinter einer physischen Taste, oder nichts. */ |
| 164 | function letterOfCode(code: string): string | undefined { |
no outgoing calls
no test coverage detected