Skip to content

Initial height is incorrect in Firefox #366

@noahtallen

Description

@noahtallen

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 (WordPress/gutenberg#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.

Untitled.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions