Add upper/lower option to getVirtualItemForOffset #961
Unanswered
markjaniczak
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
If you have gaps in your virtualizer,
getVirtualItemForOffset
will return the item before the gap if you provide it an offset that sits over one. Sometimes I want it to return the next item instead. At the moment I'm doing this manually but it would be helpful to have an option in this function to return the upper or lower bound for an offset.I think this is just a case of updating the binary search to include an optional parameter:
virtual/packages/virtual-core/src/index.ts
Lines 1086 to 1110 in f5076f1
Alernatively, it might be helpful to have an alternative to this function that can determine if there's a gap or virtual item at a given offset.
Beta Was this translation helpful? Give feedback.
All reactions