Andarist / Andarist/react-textarea-autosize

Incorrect initial height when animating from max-width: 0

オープン
#215 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
TypeScript
スター
2.4k
フォーク
247
PR マージ指標
30日以内にマージされた PR はありません

説明

**Do you want to request a feature or report a bug?**
Bug

**What is the current behavior?**
The strange is behaviour is observed under the following conditions:
- A view that contains a `TextArea` is animated in starting with `max-width: 0` (I used `react-transition-group`)
- `TextArea` is `width: 100%` (or `flex: 1` if `display: flex` is used on parent)

The behaviour is that the `TextArea` is initiated with the height with so many rows as there are characters in the `defaultValue`. So, if I initiate `TextArea` with value `abc`, the height will be 3 rows, and if with `abcde` value - 5 rows.

**If the current behavior is a bug, please provide the steps to reproduce it**
I managed to reproduce this behaviour which can be seen with slow animation [here](https://codesandbox.io/embed/nn30ppzrzl).

**What is the expected behavior?**
I would expect the `TextArea` to be initiated with the height that it should have if there was no animation, i.e. animation should not affect the height calculation.

**Which versions, and which browser / OS are affected by this issue? Did this work in previous versions?**
Chrome on Mac OS and codesandbox are the ones I've tried.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。