diff --git a/source/index.tsx b/source/index.tsx index 09927ee..f7b464e 100644 --- a/source/index.tsx +++ b/source/index.tsx @@ -71,6 +71,15 @@ export const resize: Resize = (rows, el) => { el.style.height = '0' el.style.overflowY = overflowY el.style.height = `${getHeight(rows, el)}px` + + if (document.activeElement === el) { + if ( + el.getBoundingClientRect().bottom > window.innerHeight && + el.selectionStart === el.value.length + ) { + window.scrollTo(el.scrollLeft, el.scrollTop + el.scrollHeight) + } + } } }