Skip to content

Autogrow textarea #455

@cburschka

Description

@cburschka

To expand on #420, the field could theoretically grow (up to a set height) when text is entered.

As it is right now, the textarea is easily altered by simply setting the rows property to any integer value.

By setting the container's max-height, we can put a hard limit on how much the textarea can grow.

The area's contents' line count can be calculated by dividing the area's scrollHeight property (minus its vertical padding) by the lineHeight CSS property (14px by default).

Problem: The scroll height is at least the element's actual height, so a naive implementation will allow the text area to grow as text is entered, but never shrink.

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