Andarist / Andarist/react-textarea-autosize

Scroll when new row is inserted beyond maxRows

Abierto
#142 0 comentarios 3 reacciones 0 asignados Ver en GitHub
enhancement
Lenguaje dominante
TypeScript
Estrellas
2.4k
Forks
247
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

Problem is that often built-in scroll while typing, creating new row and focusing is not enough - aesthetically wise.

I would propose introducing additional auto scroll behaviour when new row is created, either to the bottom of the textarea or to something similar to this formula:
```javascript
var { lineHeight, fontSize } = window.getComputedStyle(textareaRef)
textareaRef.scrollTop = textareaRef.scrollTop + (parseInt(lineHeight, 10) - parseInt(fontSize, 10))/2
```
Personally I think that scrolling to the bottom would be a better choice though.

Im happy to create a PR for this, but need to know first if you are interested in such a feature.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.