Andarist / Andarist/react-textarea-autosize

Initial height is incorrect in Firefox

Aperta
#366 5 commenti 4 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
TypeScript
Stelle
2.4k
Fork
247
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.