Skip to content

UI - ScrollView: Horizontal measurement / scrolling isn't working correctly #287

Description

@bryphe

Issue: If a <ScrollView /> is wrapped around a child element that overflows, it won't show a horizontal scroll bar.

Inside the ScrollView control, we create a container around the children - and we compare the size of the container and the size of the children to see if we need to show scrollbars.

For vertical scrolling, the height of the container and children is reported accurately, and if the child height is greater than the container height, we show scrollbars.

However, this isn't the case for horizontal scrollbars - we aren't getting the expected values reported for the width of the element.

This is potentially a styling / flex issue - probably just a bug in how we are applying styles.

There's a few related spots in the code that we could start looking. I kept in some debug logging to check the child width vs container width:

In addition, there's a descriptive comment here:

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-componentsArea: Consumer-exposed components providing some convenience over the primitivesbugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions