(event: Event)
| 210 | } |
| 211 | |
| 212 | onInput(event: Event): void { |
| 213 | const textarea = event.target as HTMLTextAreaElement; |
| 214 | textarea.style.height = 'auto'; // Reset height to calculate new scrollHeight |
| 215 | |
| 216 | const computedStyle = getComputedStyle(textarea); |
| 217 | const lineHeight = parseFloat(computedStyle.lineHeight); |
| 218 | const maxHeight = lineHeight * 5; |
| 219 | |
| 220 | const newHeight = Math.min(textarea.scrollHeight, maxHeight); |
| 221 | textarea.style.height = `${newHeight}px`; |
| 222 | |
| 223 | // Ensure it scrolls to the bottom if maxHeight is reached |
| 224 | if (textarea.scrollHeight > maxHeight) { |
| 225 | textarea.scrollTop = textarea.scrollHeight; |
| 226 | } |
| 227 | } |
| 228 | } |
nothing calls this directly
no outgoing calls
no test coverage detected