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
Is your feature request related to a problem? Please describe.
How to use
scrollRefis one of the pitfalls when we useVirtualizercomponent. An incorrect assignment ofscrollRefcan disable virtualization unintentionally (e.g. #690 ).Why I chose
scrollRefAPI was to supportScrollAreaof 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
scrollRefprop as opt-in for edge cases like radix-ui.Describe alternatives you've considered
Continue using
scrollRef.Additional context
#769