Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: API for accessing 'scroll' properties of the inner list element #308

Open
Lordfirespeed opened this issue Sep 30, 2024 · 0 comments
Open

Comments

@Lordfirespeed
Copy link

Lordfirespeed commented Sep 30, 2024

I'm trying to implement something like https://github.com/PrinceLoren/shadcn-combobox-virtualized-infinity/.

They aren't using the Command.List primitive because they need access to the scrollTop (and a couple of other properties) of the scroll container, to know when to load more results.

I would prefer to continue using the Command.List primitive, especially since that was made mandatory in [email protected], but would need access to its ref to be able to implement what I want; alternatively, to be specific, the functionality I need consists of

  • a boolean isScrolledToBottom, which is a function of
    • scrollHeight
    • scrollTop
    • clientHeight
  • the ability to register an onScroll listener, probably via some negotiator that merges or registers listeners in case multiple are registered

Exporting the useCommand hook would be sufficient for me, but #104 was closed as 'not planned' so that might be off the table.
Perhaps another hook such as useCommandListScroll ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant