Andarist / Andarist/react-textarea-autosize

Scroll when new row is inserted beyond maxRows

未关闭
#142 0 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看
enhancement
主要语言
TypeScript
星标
2.4k
派生
247
PR 合并指标
30 天内没有已合并 PR

描述

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.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。