Andarist / Andarist/react-textarea-autosize

Scroll when new row is inserted beyond maxRows

Ouverte
#142 0 commentaires 3 réactions 0 personnes assignées Voir sur GitHub
enhancement
Langage dominant
TypeScript
Étoiles
2.4k
Forks
247
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.