Skip to content

[Textarea] Autosize causes visual jump #52

Description

@olegpolyakov

Component

Textarea

Problem

File: Textarea.tsx lines 153-156

Autosize function sets height to 0 first:

function autosizeTextarea(textarea: HTMLTextAreaElement) {
    textarea.style.height = '0px';  // Causes visual jump
    textarea.style.height = textarea.scrollHeight + 'px';
}

Suggested Fix

textarea.style.height = 'auto';
textarea.style.height = \`\${textarea.scrollHeight}px\`;

Or use a hidden mirror element.

Impact

Visual flickering when typing

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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