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 cmdk@1.0.0, 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 ?
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 thescrollTop
(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 incmdk@1.0.0
, but would need access to itsref
to be able to implement what I want; alternatively, to be specific, the functionality I need consists ofisScrolledToBottom
, which is a function ofscrollHeight
scrollTop
clientHeight
onScroll
listener, probably via some negotiator that merges or registers listeners in case multiple are registeredExporting 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 asuseCommandListScroll
?