Andarist / Andarist/react-textarea-autosize

Initial height is incorrect in Firefox

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

Description

I'm working on migrating to this package from `react-textarea-autosize` (because it isn't maintained anymore and doesn't support React 18) in a large project (https://github.com/WordPress/gutenberg/pull/48215)

I've come across a bug where the initial height is sometimes calculated incorrectly. This bug only happens in Firefox, not Chrome or Safari.

We have a large editor which has a WYSIWYG mode, and a plain-text/HTML mode. Typically, you edit in the visual editor, but may need to switch to the "code" editor for some things. This code editor uses the autosize textarea. I've found that if the editor uses the autosize textarea on _first page load_, it is the correct size. However, if we switch to the textarea _after_ the first page load, it doesn't calculate the height properly (and just uses min rows/min height).

After interacting with the textarea, or even resizing the page, it adjusts to the correct size.

https://user-images.githubusercontent.com/6265975/219794503-2f3282f2-0395-4839-a3e7-f7dc115d0131.mp4

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.