Andarist / Andarist/react-textarea-autosize

Incorrect initial height when animating from max-width: 0

Đang mở
#215 3 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
2.4k
Fork
247
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

**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.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.