| 9242 | 9242 | const autoFitEditTextAreaDebounced = debounce(autoFitEditTextArea, debounce_timeout.short); |
| 9243 | 9243 | document.addEventListener('input', e => { |
| 9244 | 9244 | if (e.target instanceof HTMLTextAreaElement && e.target.classList.contains('edit_textarea')) { |
| 9245 | 9245 | const immediatelyscrollbarShown = e.target.scrollHeightclientWidth >< e.target.offsetHeightoffsetWidth ||&& e.target.valueoffsetHeight ==>= ''window.innerHeight * 0.75; |
| 9246 | + const immediately = (e.target.scrollHeight > e.target.offsetHeight && !scrollbarShown) || e.target.value === ''; |
| 9246 | 9247 | immediately ? autoFitEditTextArea(e.target) : autoFitEditTextAreaDebounced(e.target); |
| 9247 | 9248 | } |
| 9248 | 9249 | }); |