Andarist / Andarist/react-textarea-autosize

Blinks in Firefox when rendered on server and then re-rendered on the client.

Open
#275 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
2.4k
Forks
247
PR merge metrics
No merged PRs in 30d

Description

An example:

```

```

is rendered on the server (using react server-side rendering) and then re-rendered on the client using exactly the same argument.

When it is re-rendered on the client, component recomputes the height differently than when it is done by the Firefox 76.0.1 (looks fine on Chrome), so page jumps on load.

I have made a small online demo here: https://learn-idris.net/textarea-autosize-blink

What might be the solution:
* fix some styles to make initial rendering identical to computed rendering (probably hard)
* add an option to explicitly disable computation of height on initialization; recompute height only on a change
* maybe turn on this option when both `rows` and `minRows` specified

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.