Skip to content

Consider implementing auto-detection of scrollRef #845

@inokawa

Description

@inokawa

Is your feature request related to a problem? Please describe.
How to use scrollRef is one of the pitfalls when we use Virtualizer component. An incorrect assignment of scrollRef can disable virtualization unintentionally (e.g. #690 ).

Why I chose scrollRef API was to support ScrollArea of radix-ui, which didn't have scrollable style on mount for some reason. Maybe now is a good time to revisit since base-ui v1 has been released.

Describe the solution you'd like
Implement auto-detection of scrollable element. Find the nearest scrollable element and log error(or warn) if it is not found. Keep scrollRef prop as opt-in for edge cases like radix-ui.

Describe alternatives you've considered
Continue using scrollRef.

Additional context
#769

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