Skip to content

TextArea scrollbar and wrapping interaction on initial render is broken #5103

Open
@darrenburns

Description

@darrenburns

The following is an educated guess at the problem spotted by @TomJGooding in #5099 (comment) (includes a video example of the issue)...

When a TextArea has wrapping enabled and is filled with content that results in a scrollbar appearing, it looks like the initial wrap is not accounting for the scrollbar, causing the content to be wrap at scrollbar_width wider than it should be.

When the text area wraps, it does account for scrollbar_width, but it seems like the scrollbar width value hasn't "settled" yet during that initial wrap.

Also important to note is that this is a bit of a chicken and egg scenario - a vertical scrollbar will appear if the height of the content exceeds the TextArea height. We can't know the height of the content until we wrap though, and we can't know the exact width to wrap at unless we know if there's a scrollbar or not.

Adding scrollbar-gutter: stable works around the problem, but it still has a brief flicker when the TextArea first appears where it seems to wrap assuming a width 0 scrollbar.

After moving the cursor, the TextArea is "aware" of the scrollbar and accounts for it.

The code in #5099 includes a TextArea that exhibits this problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions